Created on 2009-01-21.00:00:00 last changed 162 months ago
Proposed resolution:
Change [time.duration.cons], p4:
template <class Rep2, class Period2> duration(const duration<Rep2, Period2>& d);-4- Requires: treat_as_floating_point<rep>::value shall be true or both ratio_divide<Period2, period>::type::den shall be 1 and treat_as_floating_point<Rep2>::value shall be false. Diagnostic required. [Note: This requirement prevents implicit truncation error when converting between integral-based duration types. Such a construction could easily lead to confusion about the value of the duration. — end note]
[ 2009-10 Santa Cruz: ]
Not completely addressed by 1177. Move to Ready.
[ 2009-08-01 Howard adds: ]
Addressed by 1177.
[ 2009-07 Frankfurt ]
Moved from Tentatively Ready to Open only because the wording needs to be improved for enable_if type constraining, possibly following Robert's formula.
[ Batavia (2009-05): ]
We agree with the proposed resolution.
Move to Tentatively Ready.
The following code should not compile because it involves implicit truncation errors (against the design philosophy of the duration library).
duration<double> d(3.5);
duration<int> i = d; // implicit truncation, should not compile
This intent was codified in the example implementation which drove this proposal but I failed to accurately translate the code into the specification in this regard.
History | |||
---|---|---|---|
Date | User | Action | Args |
2011-08-23 20:07:26 | admin | set | status: wp -> c++11 |
2010-10-21 18:28:33 | admin | set | messages: + msg4635 |
2010-10-21 18:28:33 | admin | set | messages: + msg4634 |
2010-10-21 18:28:33 | admin | set | messages: + msg4633 |
2010-10-21 18:28:33 | admin | set | messages: + msg4632 |
2010-10-21 18:28:33 | admin | set | messages: + msg4631 |
2009-01-21 00:00:00 | admin | create |