Curious. I guess the implementors of the stl are allowed to define undefined behaviour, but we are not?
MSVC\14.43.34808\include\stdexcept:100
_EXPORT_STD class runtime_error : public exception { // base of all runtime-error exceptions
public:
using _Mybase = exception;
explicit runtime_error(const string& _Message) : _Mybase(_Message.c_str()) {}
explicit runtime_error(const char* _Message) : _Mybase(_Message) {}
#if !_HAS_EXCEPTIONS
protected:
void _Doraise() const override { // perform class-specific exception handling
_RAISE(*this);
}
#endif // !_HAS_EXCEPTIONS
};
Or tell me this is doing more than taking the temporary string address?