Title
duration streaming precondition should be a SFINAE condition
Status
resolved
Section
[time.duration.io]
Submitter
Johel Ernesto Guerrero Peña

Created on 2018-06-23.00:00:00 last changed 41 months ago

Messages

Date: 2020-11-09.00:00:00

[ 2020-11-09 Resolved for C++20. Status changed: Tentatively Resolved → Resolved. ]

Date: 2020-02-15.00:00:00

[ 2020-02-13, Prague ]

Will be resolved by LWG 3317.

Date: 2018-08-23.00:00:00

[ 2018-08-23 Batavia Issues processing ]

Marshall to talk to Howard about his intent. Status to Open

Previous resolution [SUPERSEDED]:

This wording is relative to N4750.

Change [time.duration.io] as indicated:

[Drafting note: The suggested wording changes include the insertion of two bullets into the existing running text to improve clarification of the logic arm of the "unless"].

template<class charT, class traits, class Rep, class Period>
  basic_ostream<charT, traits>&
    operator<<(basic_ostream<charT, traits>& os, const duration<Rep, Period>& d);

-1- RequiresRemarks: This function shall not participate in overload resolution unless:

  • Rep is an integral type whose integer conversion rank ([conv.rank]) is greater than or equal to that of short, or a floating point type., and

  • charT is char or wchar_t

[…]

Date: 2018-07-20.00:00:00

[ 2018-07-20 Priority set to 2 after reflector discussion. NAD and P0 were also mentioned. ]

Date: 2018-06-15.00:00:00

[ 2018-06-29; Daniel comments ]

The wording will be significantly simplified by the application of the new Library element Constraints: introduced by P0788R3 and available with the post-Rapperswil working draft.

Date: 2018-06-29.19:02:59

[time.duration.io]/1 states:

template<class charT, class traits, class Rep, class Period>
  basic_ostream<charT, traits>&
    operator<<(basic_ostream<charT, traits>& os, const duration<Rep, Period>& d);

Requires: Rep is an integral type whose integer conversion rank ([conv.rank]) is greater than or equal to that of short, or a floating point type. charT is char or wchar_t.

I think the intention was to make this a compile-time error, since all the information to make it so is available at compile-time. But the wording doesn't suggest that.

History
Date User Action Args
2020-11-09 22:09:58adminsetmessages: + msg11599
2020-02-13 18:38:05adminsetstatus: open -> resolved
2018-08-27 14:22:44adminsetmessages: + msg10137
2018-08-27 14:22:44adminsetstatus: new -> open
2018-07-20 21:06:57adminsetmessages: + msg10032
2018-06-29 19:02:59adminsetmessages: + msg9996
2018-06-27 17:57:08adminsetmessages: + msg9991
2018-06-23 00:00:00admincreate