RFC: (in head) Throws()?

From: Kinkie <gkinkie_at_gmail.com>
Date: Mon, 13 Oct 2008 11:44:07 +0200

Hi all.

I've recently found myself battlign with a certain difficulty in
formatting custom messages for thrown exceptions; in order to use
TextExceptions properly I'd have to set a stringstream up, fill it in,
get a c_str out and then Throw, leaking memory in the meantime because
the message would be double-copied and there'd be no reachable code to
free one of the copies. The current Throw() implementation is very
skewed towards servicing Must().

All of this should be easily solvable by defining a Throws() macro
(possibly with an accompanying Musts call) which would offer semantics
similar to debugs(), and get rid of this wart in one easy sweep.

Any opinions?

-- 
    /kinkie
Received on Mon Oct 13 2008 - 10:55:17 MDT

This archive was generated by hypermail 2.2.0 : Mon Oct 13 2008 - 12:00:03 MDT