<div dir="ltr">Hi Alex<div><br></div><div>We can:</div><div><ul><li>declare time::duration<Rep, Period> as a new class that inherits from boost::chrono::duration<Rep, Period></li><li>in time::duration<Rep, Period>, provide an implicit conversion function to std::chrono::duration<Rep2, Period2>, and use enable_if to restrict the equivalence of Rep-Rep2 and Period-Period2</li><li>in time::duration<Rep, Period>, provide an implicit constructor from std::chrono::duration<Rep2, Period2>, and use enable_if to restrict the equivalence of Rep-Rep2 and Period-Period2</li></ul></div><div><br></div><div>The alternate is:</div><div><ul><li>typedef std::chrono::duration as time::duration</li><li>implement operator<<(std::ostream&, time::duration) overloads that prints the duration by internally converting to boost::chrono::duration</li></ul></div><div><br></div><div>Yours, Junxiao<br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 13, 2014 at 3:25 PM, Alex Afanasyev <span dir="ltr"><<a href="mailto:alexander.afanasyev@ucla.edu" target="_blank">alexander.afanasyev@ucla.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5"><br>
> On Nov 13, 2014, at 1:58 PM, Junxiao Shi <<a href="mailto:shijunxiao@email.arizona.edu">shijunxiao@email.arizona.edu</a>> wrote:<br>
><br>
> Dear folks<br>
><br>
> Whether ndn::time is using boost::chrono or std::chrono shall be an implementation detail.<br>
> I think we should provide implicit conversion operators between ndn::time::duration<Rep,Period> and std::chrono::duration<Rep,Period>, when Rep is the same and Period is equivalent.<br>
<br>
</div></div>Is there a way to do it without us creating our own class?  I don’t seem to find a simple way for that.  I really don’t want us to create duration class and implement everything that is implemented in std/boost::chrono<br>
<br>
<br>
</blockquote></div><br></div></div></div>