Title
The standard library should provide string_view parameters instead or in addition for functions defined with char const * or string const & as parameter types.
Status
lewg
Section
[string.view]
Submitter
Switzerland

Created on 2017-02-03.00:00:00 last changed 90 months ago

Messages

Date: 2017-07-15.23:15:19

[ 2017-07 Toronto Thurs Issue Prioritization ]

Status LEWG - they're already looking at this.

Date: 2017-06-26.19:00:17

[ Post-Kona 2017 ]

Most (all?) of these changes were proposed in P0506r1, which was discussed by LEWG in Kona.

Date: 2017-02-03.00:00:00
Addresses CH 9

The standard library should provide string_view parameters instead or in addition for functions defined with char const * or string const & as parameter types. Most notably in cases where both such overloads exist or where an internal copy is expected anyway.

It might be doubted that the non-null termination of string_view could be an issue with functions that pass the char * down to OS functions, such as fstream_buf::open() etc. and those shouldn't provide it and favour generating a std::string temporary instead in that case. However, std::path demonstrates it is usable to have string_view overloads and there might be many places where it can be handy, or even better.

Proposed change: Provide the overloads for std::regex, the exception classes, std::bitset, std::locale and more.

History
Date User Action Args
2017-07-15 23:15:19adminsetmessages: + msg9388
2017-07-15 23:15:19adminsetstatus: new -> lewg
2017-06-26 19:00:17adminsetmessages: + msg9290
2017-02-03 00:00:00admincreate