Title
basic_regex should be created/assigned from initializer lists
Status
c++11
Section
[re.regex.construct]
Submitter
Alisdair Meredith

Created on 2009-03-11.00:00:00 last changed 162 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Change [re.regex]:

template <class charT,
          class traits = regex_traits<charT> >
class basic_regex {
  ...
  basic_regex& operator=(const charT* ptr);
  basic_regex& operator=(initializer_list<charT> il);
  template <class ST, class SA>
    basic_regex& operator=(const basic_string<charT, ST, SA>& p);
  ...
};

Add in [re.regex.construct]:

-20- ...

basic_regex& operator=(initializer_list<charT> il);

-21- Effects: returns assign(il.begin(), il.end());

Date: 2010-10-21.18:28:33

[ Batavia (2009-05): ]

UK 317 asks for both assignment and constructor, but the requested constructor is already present in the current Working Paper. We agree with the proposed resolution. Move to Tentatively Ready.

Date: 2012-10-21.13:19:07

Addresses UK 317 and JP 74

UK 317:

basic_string has both a constructor and an assignment operator that accepts an initializer list, basic_regex should have the same.

JP 74:

basic_regex & operator= (initializer_list<T>); is not defined.

History
Date User Action Args
2011-08-23 20:07:26adminsetstatus: wp -> c++11
2010-10-21 18:28:33adminsetmessages: + msg326
2010-10-21 18:28:33adminsetmessages: + msg325
2009-03-11 00:00:00admincreate