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]

Re: Fw: Re:[v3] system_error, round one


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?

Regards,
Didier.

----- Original Message ----- From: "Benjamin Kosnik" <bkoz@redhat.com>
To: "Didier" <dspezia@club-internet.fr>
Cc: <libstdc++@gcc.gnu.org>
Sent: Tuesday, May 15, 2007 12:28 PM
Subject: Re: Fw: Re:[v3] system_error, round one




sorry if my remark is silly, but isn't the pointer
returned by this method dangling ?

Yes.


The non-normative wording in the proposal was suggesting to modify a member string object in a const member function, which doesn't really fly. I just added this to get a clean compile.

:(

-benjamin




--
J'utilise la version gratuíte de SPAMfighter pour utilisateurs privés.
Ce programme a supprimé477 d'e-mails spam à ce jour.
Les utilisateurs qui paient n'ont pas ce message dans leurse-mails.
Obtenez la version gratuite de SPAMfighter ici: http://www.spamfighter.com/lfr



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]