Title
println ignores the locale imbued in std::ostream
Status
wp
Section
[ostream.formatted.print]
Submitter
Jens Maurer

Created on 2024-04-30.00:00:00 last changed 3 weeks ago

Messages

Date: 2024-11-28.21:40:31

Proposed resolution:

This wording is relative to N4981.

  1. Modify [ostream.formatted.print] as indicated:

    template<class... Args>
      void println(ostream& os, format_string<Args...> fmt, Args&&... args);
    

    -2- Effects: Equivalent to:

    print(os, "{}\n", format(os.getloc(), fmt, std::forward<Args>(args)...));
    
Date: 2024-11-28.21:40:31

[ Wrocław 2024-11-23; Status changed: Voting → WP. ]

Date: 2024-10-15.00:00:00

[ 2024-10-03; Reflector poll ]

Set status to Tentatively Ready after seven votes in favour during reflector poll.

Date: 2024-04-30.00:00:00

[ostream.formatted.print] specifies that std::print uses the locale imbued in the std::ostream& argument for formatting, by using this equivalence:

vformat(os.getloc(), fmt, args);

(in the vformat_(non)unicode delegation).

However, std::println ignores the std::ostream's locale for its locale-dependent formatting:

print(os, "{}\n", format(fmt, std::forward<Args>(args)...));

This is inconsistent.

History
Date User Action Args
2024-11-28 21:40:31adminsetmessages: + msg14481
2024-11-28 21:40:31adminsetstatus: voting -> wp
2024-11-19 16:09:07adminsetstatus: ready -> voting
2024-10-03 09:07:10adminsetmessages: + msg14412
2024-10-03 09:07:10adminsetstatus: new -> ready
2024-05-04 15:39:15adminsetmessages: + msg14100
2024-04-30 00:00:00admincreate