Title
duration_cast improperly specified
Status
nad
Section
[time.duration.cast]
Submitter
Pete Becker

Created on 2008-12-20.00:00:00 last changed 163 months ago

Messages

Date: 2010-10-21.18:28:33

[ Batavia (2009-05): ]

We view this as a specific case of issue 952, and should be resolved when that issue is resolved.

Move to NAD.

Date: 2010-10-21.18:28:33

[ Howard adds: ]

The intent of this remark is that intermediate computations are carried out using:

common_type<typename ToDuration::rep, Rep, intmax_t>::type

The Remark was intended to be clarifying prose supporting the rather algorithmic description of the previous paragraph. I'm open to suggestions. Perhaps the entire paragraph 3 (Remarks) would be better dropped?

Date: 2008-12-20.00:00:00

[time.duration.cast]/3:

.... All intermediate computations shall be carried out in the widest possible representation... .

So ignoring floating-point types for the moment, all this arithmetic has to be done using the implementation's largest integral type, even if both arguments use int for their representation. This seems excessive. And it's not at all clear what this means if we don't ignore floating-point types.

This issue is related to 952.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg4490
2010-10-21 18:28:33adminsetmessages: + msg4489
2008-12-20 00:00:00admincreate