This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Fw: Re:[v3] system_error, round one
- From: " Didier" <dspezia at club-internet dot fr>
- To: "Benjamin Kosnik" <bkoz at redhat dot com>
- Cc: <libstdc++ at gcc dot gnu dot org>
- Date: Tue, 15 May 2007 12:58:34 +0200
- Subject: Re: Fw: Re:[v3] system_error, round one
- References: <005a01c796db$1cb819e0$0201a8c0@DS01> <46498B3D.6030902@redhat.com>
- Reply-to: " Didier" <dspezia at club-internet dot fr>
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