Google's Go & Exceptions
Walter Bright
newshound1 at digitalmars.com
Tue Jan 26 17:46:10 PST 2010
Ary Borenszweig wrote:
> auto x = new BigInt(someString);
>
> How do you implement BigInt's constructor without being able to throw an
> exception?
I presume you mean how can it work without allocating memory. In D, a
memory allocation failure is generally not a recoverable exception, it's
a fatal exception.
A better example would be one that attempted to open a file in the
constructor.
More information about the Digitalmars-d
mailing list