Assert
Derek Parnell
derek at nomail.afraid.org
Thu Jun 28 23:53:33 PDT 2007
On Thu, 28 Jun 2007 23:08:45 -0700, David B. Held wrote:
> something like so:
>
> #define enforce(cond, message) \
> if (!cond) throw SomeException(#cond + ": " + message);
>
> Bar* ptr = foo();
> enforce(ptr != null, "foo() failed");
Isn't ...
assert(ptr !is null, "foo() failed to supply a valid Bar pointer");
okay to use?
--
Derek
(skype: derek.j.parnell)
Melbourne, Australia
29/06/2007 4:52:03 PM
More information about the Digitalmars-d
mailing list