Subject: [Boost-bugs] [Boost C++ Libraries] #7041: time_point.hpp depends on Boost.System
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-06-28 12:51:16
#7041: time_point.hpp depends on Boost.System
-------------------------------------+--------------------------------------
Reporter: 1czajnik@⦠| Owner: viboes
Type: Bugs | Status: new
Milestone: To Be Determined | Component: chrono
Version: Boost Development Trunk | Severity: Problem
Keywords: |
-------------------------------------+--------------------------------------
Hello,
Problem:
The file boost/chrono/time_point.hpp #includes
<boost/chrono/detail/system.hpp>, 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.
Proposed solution:
remove #include <boost/chrono/detail/system.hpp> from
boost/chrono/time_point.hpp.
Rationale:
Suppose I want to create my own clock class, and in it among other things
I would like to typedef a time_point<...>.
{{{
struct MyClock
{
typedef int64_t rep;
typedef boost::milli period;
typedef boost::chrono::duration<rep,period> duration;
typedef boost::chrono::time_point<MyClock,duration> time_point;
static bool const is_steady = false;
static time_point now();
};
}}}
Now, for this to work it is necessary to #include
<boost/chrono/time_point.hpp>. Including it causes a dependency on
Boost.System.
Cheers,
Kris
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7041> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:09 UTC