This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
Ah yes, it seems N2066 is flawed on this point. I suppose you refer to:
private: string what_msg; // for exposition only
and then:
const char * what() const;
Returns: If !code() || !append_message(), return this->runtime_error::what(). Otherwise, as if:
what_msg = this->runtime_error::what();
if ( !what_msg.empty() ) what_msg += ": ";
what_msg += code().message();
return what_msg.c_str();
Generally speaking, the idea of embedding a std::string into an exception object
sounds questionable to me. Can't a string constructor throw itself an exception?
On the other hand, I don't see many solutions ...
If a std::string member must really be used, perhaps you could tag it as mutable?
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |