Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

operator- Operator (STL)

Operator for subtraction or negation of duration and time_point objects.

template<
   class Rep1, class Period1,
   class Rep2, class Period2>
   constexpr typename common_type<
      duration<Rep1, Period1>, 
      duration<Rep2, Period2> >::type
   operator-(
      const duration<Rep1, Period1>& Left,
      const duration<Rep2, Period2>& Right);

template<class Clock, class Duration1, class Rep2, class Period2>
   constexpr time_point<Clock, 
      typename common_type<Duration1, duration<Rep2, Period2> >::type>
   operator-(
      const time_point<Clock, Duration1>& Time,
      const duration<Rep2, Period2>& Dur);

template<class Clock, class Duration1, class Duration2>
   typename common_type<Duration1, Duration2>::type
   operator-(
      const time_point<Clock, Duration1>& Left,
      const time_point<Clock, Duration2>& Right);
Left

The left duration or time_point object.

Right

The right duration or time_point object.

Time

A time_point object.

Dur

A duration object.

The first function returns a duration object whose interval length is the difference between the time intervals of the two arguments.

The second function returns a time_point object that represents a point in time that is displaced, by the negation of the time interval that is represented by Dur, from the point in time that is specified by Time.

The third function returns a duration object that represents the time interval between Left and Right.

Header: chrono

Namespace: std::chrono

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.