Opened 12 years ago

Closed 12 years ago

#5328 closed Feature Requests (fixed)

Addition of increment and decrement operators to chrono::time_point

Reported by: Joachim Faulhaber Owned by: viboes
Milestone: Boost 1.47.0 Component: chrono
Version: Boost Development Trunk Severity: Problem
Keywords: increment decrement chrono time_point Cc:

Description

From the viewpoint of generic interoperability fundamental operations are needed for possible generic recipient libraries of boost::chrono, that impose some fundamental requirements on their parameter types. E.g. Intervals and interval containers of Boost.Icl rely on the existence of an increment and decrement operator for intervals an interval containers of chrono::time_points.

time_point& operator++() is an incrementation of one least steppable unit for integral rep types and a unit step for floating point rep types. It repesents one tick of the clock and is equivalent with incrementing the time_point's duration. So it can be efficiently implemented by incrementation of the underlying rep_ member. This ticket requests the addition of the four common in/decrementation operations:

time_point& operator++()   ;
time_point  operator++(int);
time_point& operator--()   ;
time_point  operator--(int);

Change History (2)

comment:1 by viboes, 12 years ago

Fixed at Changeset #70074

comment:2 by viboes, 12 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.