On Thu, 04 Mar 2010 13:58:54 -0500, bearophile <[email protected]> wrote:

What do you think of the idea of the Exception to remember (so later it can be shown if uncaught) the line number and file name where it was instantiated?

void foo() {
    auto e = new Exception(""); // instantiation line number here
    throw e;
}
void main() {
    foo();
}

Exceptions get caught, rethrown, stored, etc. But in many cases in my code they are instantiated close to where the cause was. So knowing such line number can be useful (if you are using a debugger this is not so useful).

Bye,
bearophile

You mean, like enforce(false, "message")?

Reply via email to