This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.

2481. wstring_convert should be more precise regarding "byte-error string" etc.

Section: D.27.2 [depr.conversions.string] Status: New Submitter: Jonathan Wakely Opened: 2015-03-04 Last modified: 2017-04-22

Priority: 4

View other active issues in [depr.conversions.string].

View all other issues in [depr.conversions.string].

View all issues with New status.

Discussion:

Paragraph 4 of D.27.2 [depr.conversions.string] introduces byte_err_string as "a byte string to display on errors". What does display mean? The string is returned on error, it's not displayed anywhere.

Paragraph 14 says "Otherwise, if the object was constructed with a byte-error string, the member function shall return the byte-error string." The term byte-error string is not used anywhere else.

Paragraph 17 talks about storing "default values in byte_err_string". What default value? Is "Hello, world!" allowed? If it means default-construction it should say so. If paragraph 14 says it won't be used what does it matter how it's initialized? The end of the paragraph refers to storing "byte_err in byte_err_string". This should be more clearly related to the wording in paragraph 14.

It might help if the constructor (and destructor) was specified before the other member functions, so it can more formally define the difference between being "constructed with a byte-error string" and not.

All the same issues apply to the wide_err_string member.

Proposed resolution: