Date
2018-06-27.19:02:12
Message id
9981

Content

[time.duration]/4 states:

Members of duration shall not throw exceptions other than those thrown by the indicated operations on their representations.

Where representation is defined in the non-normative, brief description at [time.duration]/1:

[…] A duration has a representation which holds a count of ticks and a tick period. […]

[time.duration.cons]/2 doesn't indicate the operation undergone by its representation, merely stating a postcondition in [time.duration.cons]/3:

Effects: Constructs an object of type duration.

Postconditions: count() == static_cast<rep>(r).

I suggest this reformulation that follows the format of [time.duration.cons]/5.

Effects: Constructs an object of type duration, constructing rep_ from r.

Now it is clear why the constructor would throw.

Previous resolution [SUPERSEDED]:

This wording is relative to N4750.

Change [time.duration.cons] as indicated:

template<class Rep2>
  constexpr explicit duration(const Rep2& r);

-1- Remarks: This constructor shall not participate in overload resolution unless […]

-2- Effects: Constructs an object of type duration, constructing rep_ from r.

-3- Postconditions: count() == static_cast<rep>(r).