1271. CR undefined in duration operators

Section: 23.17.5.5 [time.duration.nonmember] Status: C++11 Submitter: Daniel Krügler Opened: 2009-11-21 Last modified: 2016-02-10

Priority: Not Prioritized

View all other issues in [time.duration.nonmember].

View all issues with C++11 status.

Discussion:

IMO CR alone is not really defined (it should be CR(Rep1, Rep2)).

[ 2009-12-24 Moved to Tentatively Ready after 5 positive votes on c++std-lib. ]

Proposed resolution:

Change 23.17.5.5 [time.duration.nonmember] paragraphs 9 and 12:

template <class Rep1, class Period, class Rep2>
  duration<typename common_type<Rep1, Rep2>::type, Period>
  operator/(const duration<Rep1, Period>& d, const Rep2& s);

9 Returns: duration<CR(Rep1, Rep2), Period>(d) /= s.

template <class Rep1, class Period, class Rep2>
  duration<typename common_type<Rep1, Rep2>::type, Period>
  operator%(const duration<Rep1, Period>& d, const Rep2& s);

12 Returns: duration<CR(Rep1, Rep2), Period>(d) %= s.