Boost C++ Libraries: Ticket #7041: time_point.hpp depends on Boost.System https://svn.boost.org/trac10/ticket/7041 <p> Hello, </p> <p> Problem: The file boost/chrono/time_point.hpp #includes &lt;boost/chrono/detail/system.hpp&gt;, and it doesn't appear to need it. This creates an unnecessary dependency on Boost.System, even though no clock provided by Boost.Chrono is used. </p> <p> Proposed solution: remove #include &lt;boost/chrono/detail/system.hpp&gt; from boost/chrono/time_point.hpp. </p> <p> Rationale: Suppose I want to create my own clock class, and in it among other things I would like to typedef a time_point&lt;...&gt;. </p> <pre class="wiki">struct MyClock { typedef int64_t rep; typedef boost::milli period; typedef boost::chrono::duration&lt;rep,period&gt; duration; typedef boost::chrono::time_point&lt;MyClock,duration&gt; time_point; static bool const is_steady = false; static time_point now(); }; </pre><p> Now, for this to work it is necessary to #include &lt;boost/chrono/time_point.hpp&gt;. Including it causes a dependency on Boost.System. </p> <p> Cheers, Kris </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7041 Trac 1.4.3 viboes Thu, 28 Jun 2012 20:53:43 GMT attachment set https://svn.boost.org/trac10/ticket/7041 https://svn.boost.org/trac10/ticket/7041 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">7041.patch</span> </li> </ul> Ticket viboes Thu, 28 Jun 2012 20:54:36 GMT status changed https://svn.boost.org/trac10/ticket/7041#comment:1 https://svn.boost.org/trac10/ticket/7041#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> Please, could you tell me if the attached patch solves the issue when BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING is defined? </p> Ticket 1czajnik@… Fri, 29 Jun 2012 14:00:45 GMT <link>https://svn.boost.org/trac10/ticket/7041#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7041#comment:2</guid> <description> <p> Yes, the patch + #define BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING fixes it. Thanks for looking into this. </p> <p> I would like to ask, why would you want &lt;boost/chrono/detail/system.hpp&gt; #included in time_point.hpp? I would think time_point.hpp should *not* depend on Boost.System regardless of #defining BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING. Am I missing something? </p> <p> Cheers, Kris </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Thu, 05 Jul 2012 16:53:55 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/7041#comment:3 https://svn.boost.org/trac10/ticket/7041#comment:3 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.51.0</span> </li> </ul> Ticket viboes Sun, 08 Jul 2012 20:49:57 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7041#comment:4 https://svn.boost.org/trac10/ticket/7041#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Committed revision 79371. </p> Ticket viboes Mon, 09 Jul 2012 16:44:30 GMT <link>https://svn.boost.org/trac10/ticket/7041#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7041#comment:5</guid> <description> <p> I didn't understood the real problem. I have removed the include &lt;boost/chrono/detail/system.hpp&gt; as not needed. </p> <p> Committed in trunk revision 79381. Committed in release branch revision 79382. </p> </description> <category>Ticket</category> </item> </channel> </rss>