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

2029. Missing 'noexcept' on basic_regex move-assignment operator

Section: 28.6.7 [re.regex] Status: C++11 Submitter: Jonathan Wakely Opened: 2011-02-16 Last modified: 2016-01-28

Priority: Not Prioritized

View all other issues in [re.regex].

View all issues with C++11 status.

Discussion:

N3149 replaced the "Throws: nothing" clause on basic_regex::assign(basic_regex&&) with the noexcept keyword. The effects of the move-assignment operator are defined in terms of the assign() function, so the "Throws: nothing" applied there too, and a noexcept-specification should be added there too.

[2011-02-24 Reflector discussion]

Moved to Tentatively Ready after 7 votes.

Proposed resolution:

  1. Modify the basic_regex synopsis in 28.6.7 [re.regex] p. 3:

    namespace std {
      template <class charT,
                class traits = regex_traits<charT> >
      class basic_regex {
      public:
        ...
        basic_regex& operator=(const basic_regex&);
        basic_regex& operator=(basic_regex&&) noexcept;
        basic_regex& operator=(const charT* ptr);
        ...
      };
    }
    
  2. Modify 28.6.7.3 [re.regex.assign] p. 2:

    basic_regex& operator=(basic_regex&& e) noexcept;
    

    2 Effects: returns assign(std::move(e)).