|
Boost : |
From: Kevlin Henney (Kevlin.Henney_at_[hidden])
Date: 1999-08-31 12:28:48
Valentin Bonnard wrote:
[...]
> For boost library authors, the first need is perhaps not as great as
> that for a user dotting their own code w/ assertions. Naming and
> describing what constraint was violated is often more useful to a
> library user than receiving a mysterious message about a piece of code
> they have nothing to do w/!
This can easilly be done with a comment:
// must fobnicate before we tweak
assert (x ? t(3) : 3434==i+j);
And there was me thinking that the compiler ignored comments ;-)
If you wish to do this 'properly' w/ assert:
assert (("must fobnicate before we tweak", x ? t(3) : 3434==i+j));
I think both of these help to reinforce points about usability and
friendliness! Another point here being that library user and author are
different roles, and there can be quite different requirements for what
may superficially seem to be the same concept, ie debugging.
Kevlin
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk