2431. Missing regular expression traits requirements

Section: 28.6.2 [re.req] Status: New Submitter: Jonathan Wakely Opened: 2014-09-30 Last modified: 2020-04-16

Priority: 3

View other active issues in [re.req].

View all other issues in [re.req].

View all issues with New status.

Discussion:

The requirements on the traits class in 28.6.2 [re.req] do not say whether a regular expression traits class is required to be DefaultConstructible, CopyConstructible, CopyAssignable etc.

The std::regex_traits class appears to be all of the above, but can basic_regex assume that for user-defined traits classes?

Should the following statements all leave u in equivalent states?

X u{v};
X u; u = v;
X u; u.imbue(v.getloc();

Whether they are equivalent has implications for basic_regex copy construction and assignment.

[2020-04-16, Jonathan adds that 28.6.7.5 [re.regex.locale] requires the traits type to be default-initialized, despite no guarantee that the traits type is default constructible. ]

Proposed resolution: