3009. Including <string_view> doesn't provide std::size/empty/data

Section: 27.8 [iterator.container] Status: Tentatively Ready Submitter: Tim Song Opened: 2017-08-11 Last modified: 2017-11-01

Priority: 0

View all issues with Tentatively Ready status.

Discussion:

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.

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

Proposed resolution:

This resolution is relative to N4687.

  1. Edit 27.8 [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>.