2073. Library exceptions that take string arguments

Section: 22.2 [std.exceptions], 22.5.7 [syserr.syserr], 30.5.3.1.1 [ios::failure] Status: NAD Submitter: Eelis van der Weegen Opened: 2011-08-16 Last modified: 2016-02-10

Priority: Not Prioritized

View all other issues in [std.exceptions].

View all issues with NAD status.

Discussion:

This is an extension issue for LWG to add constructor overloads that take a string by an rvalue reference in order to move the string into the exception.

[2012, Kona]

Move to NAD.

This was discussed during C++11 standardization, and deemed (at the time) to be a conforming extension that vendors are free to add, but there seemed no need to call it out in the standard. Since then it has been noted that the rvalue-reference overloads do not give you the move-semantic guarantee the proposer is thought to be looking for, as in order to meet the requirements that copy constructors do not throw (for standard exceptions) the exceptions that store strings must actually store a reference-counted immutable string, rather than an std::string internally. Therefore, an rvalue-reference overload is going to have to allocate memory in exactly the same way as copying from a const string& argument.

Proposed resolution: