Title
Including <string_view> doesn't provide std::size/empty/data
Status
c++20
Section
[iterator.range]
Submitter
Tim Song

Created on 2017-08-11.00:00:00 last changed 45 months ago

Messages

Date: 2018-03-18.16:03:30

Proposed resolution:

This resolution is relative to N4687.

  1. Edit [iterator.container] as indicated:

    -1- In addition to being available via inclusion of the <iterator> header, the function templates in 27.8 are available when any of the following headers are included: <array>, <deque>, <forward_list>, <list>, <map>, <regex>, <set>, <string>, <string_view>, <unordered_map>, <unordered_set>, and <vector>.

Date: 2018-03-17.00:00:00

[ 2018-3-17 Adopted in Jacksonville ]

Date: 2017-11-01.00:00:00

[ 2017-11-01 Moved to Tentatively Ready after 7 positive votes for P0 on c++std-lib. ]

Date: 2017-08-11.00:00:00

basic_string_view has size(), empty(), and data() members, but including <string_view> isn't guaranteed to give you access to the corresponding free function templates. This seems surprising.

History
Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2018-03-18 16:03:30adminsetmessages: + msg9738
2018-03-18 16:03:30adminsetstatus: voting -> wp
2018-02-12 01:13:49adminsetstatus: ready -> voting
2017-11-01 18:31:36adminsetmessages: + msg9493
2017-11-01 18:31:36adminsetstatus: new -> ready
2017-08-13 10:45:11adminsetmessages: + msg9444
2017-08-11 00:00:00admincreate