Title
§[string.view.io] uses non-existent basic_string_view::to_string function
Status
c++17
Section
[string.view.io][string.io]
Submitter
Billy Baker

Created on 2016-07-26.00:00:00 last changed 90 months ago

Messages

Date: 2016-08-01.18:34:48

Proposed resolution:

This wording is relative to N4606.

  1. Modify [string.io] as indicated:

    template<class charT, class traits, class Allocator>
      basic_ostream<charT, traits>&
        operator<<(basic_ostream<charT, traits>& os,
                   const basic_string<charT, traits, Allocator>& str);
    

    -5- Effects: Equivalent to: return os << basic_string_view<charT, traits>(str);Behaves as a formatted output function ([ostream.formatted.reqmts]) of os. Forms a character sequence seq, initially consisting of the elements defined by the range [str.begin(), str.end()). Determines padding for seq as described in [ostream.formatted.reqmts]. Then inserts seq as if by calling os.rdbuf()->sputn(seq, n), where n is the larger of os.width() and str.size(); then calls os.width(0).

    -6- Returns: os

  2. Modify [string.view.io] as indicated:

    template<class charT, class traits>
      basic_ostream<charT, traits>&
        operator<<(basic_ostream<charT, traits>& os,
                   basic_string_view<charT, traits> str);
    

    -1- Effects: Equivalent to: return os << str.to_string();Behaves as a formatted output function ([ostream.formatted.reqmts]) of os. Forms a character sequence seq, initially consisting of the elements defined by the range [str.begin(), str.end()). Determines padding for seq as described in [ostream.formatted.reqmts]. Then inserts seq as if by calling os.rdbuf()->sputn(seq, n), where n is the larger of os.width() and str.size(); then calls os.width(0).

    -?- Returns: os

Date: 2016-08-06.18:46:36

[ 2016-07 Chicago LWG ]

Monday: P0 - tentatively ready

Date: 2016-07-15.00:00:00

[ 2016-07-26, Marshall suggests concrete wording ]

Date: 2016-07-26.00:00:00

In looking at N4606, [string.view.io] has an Effects clause that references basic_string_view::to_string which no longer exists after the application of P0254R2.

History
Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2016-11-14 03:59:28adminsetstatus: pending -> wp
2016-11-14 03:55:22adminsetstatus: ready -> pending
2016-08-01 18:34:48adminsetmessages: + msg8292
2016-08-01 18:34:48adminsetstatus: new -> ready
2016-07-28 18:27:47adminsetmessages: + msg8266
2016-07-28 18:27:47adminsetmessages: + msg8265
2016-07-26 00:00:00admincreate