Boost logo

Geometry :

Subject: [ggl] Definition of exception types
From: Bruno Lalande (bruno.lalande)
Date: 2009-06-17 11:12:33


> Two solutions are possible:
> a) those functions will have to throw in any case
> b) return a default constructed value of the return type The user needs to
> check for an error condition anyways, so no harm done:
> error_code e;
> T t = some_function(..., e);
> if (!e) {
> // handle error, ignoring t
> }
> I like b) more, but that's a matter of taste.
> Regards Hartmut

Yep I prefer b) too, I find that a) kind of defeats the purpose...

Obviously the problem remains if the type is not default-constructible...


Geometry list run by mateusz at