Title
basic_string_view is missing constexpr
Status
c++17
Section
[string.view]
Submitter
Billy Robert O'Neal III

Created on 2016-09-30.00:00:00 last changed 89 months ago

Messages

Date: 2016-10-08.04:58:13

Proposed resolution:

This wording is relative to N4606.

  1. In [string.view.template], add constexpr to the assignment operator:

    constexpr basic_string_view& operator=(const basic_string_view&) noexcept = default;
    
  2. In [string.view.template], add constexpr to the reverse range functions:

    constexpr const_reverse_iterator rbegin() const noexcept;
    constexpr const_reverse_iterator rend() const noexcept;
    constexpr const_reverse_iterator crbegin() const noexcept;
    constexpr const_reverse_iterator crend() const noexcept;
    
  3. In [string.view.iterators], add constexpr to the reverse range functions:

    constexpr const_reverse_iterator rbegin() const noexcept;
    constexpr const_reverse_iterator crbegin() const noexcept;
    

    -6- Returns: const_reverse_iterator(end())

    constexpr const_reverse_iterator rend() const noexcept;
    constexpr const_reverse_iterator crend() const noexcept;
    

    -7- Returns: const_reverse_iterator(begin())

Date: 2017-02-02.00:41:18

[ Issues processing Telecon 2016-10-7 ]

split off the copy into its' own issue 2780

P0; set what's left to Tentatively Ready

Previous resolution [SUPERSEDED]:

This wording is relative to N4606.

  1. In [string.view.template], add constexpr to the assignment operator:

    constexpr basic_string_view& operator=(const basic_string_view&) noexcept = default;
    
  2. In [string.view.template], add constexpr to the reverse range functions:

    constexpr const_reverse_iterator rbegin() const noexcept;
    constexpr const_reverse_iterator rend() const noexcept;
    constexpr const_reverse_iterator crbegin() const noexcept;
    constexpr const_reverse_iterator crend() const noexcept;
    
  3. In [string.view.iterators], add constexpr to the reverse range functions:

    constexpr const_reverse_iterator rbegin() const noexcept;
    constexpr const_reverse_iterator crbegin() const noexcept;
    

    -6- Returns: const_reverse_iterator(end())

    constexpr const_reverse_iterator rend() const noexcept;
    constexpr const_reverse_iterator crend() const noexcept;
    

    -7- Returns: const_reverse_iterator(begin())

  4. In [string.view.template], add constexpr to copy:

    constexpr size_type copy(charT* s, size_type n, size_type pos = 0) const;
    
  5. In [string.view.ops], add constexpr to copy:

    constexpr size_type copy(charT* s, size_type n, size_type pos = 0) const;
    
Date: 2016-09-30.00:00:00

basic_string_view was not updated to account for other library machinery made constexpr in Oulu. Now that reverse_iterator is constexpr there's no reason the reverse range functions can't be. Also, now that we have C++14 relaxed constexpr, we can also take care of the assignment operator and copy.

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-10-08 04:58:13adminsetmessages: + msg8547
2016-10-08 04:58:13adminsetstatus: new -> ready
2016-10-03 17:16:50adminsetmessages: + msg8535
2016-09-30 00:00:00admincreate