79568888

Date: 2025-04-11 13:01:41
Score: 1
Natty:
Report link

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?

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Looks like a comment (1):
  • High reputation (-1):
Posted by: Gem Taylor