In general I would argue in favor of enabling asserts by default, but since this is for what /to me/ is a third party library I'm less interested in preventing day to day programming errors inside the library. This may be impractical, but ideally I would like asserts to default on for the preconditions of functions that I use as a client and default off for internal implementation functions and classes.


-----Original Message-----
From: Peter Dimov [mailto:pdimov@mmltd.net]
Sent: Thursday, November 15, 2001 9:20 AM
To: boost@yahoogroups.com
Subject: Re: [boost] Boost.Assert


From: "Darin Adler" <darin@bentspoon.com>
> Let me try to paraphrase:
>
>     Peter: Asserts default off.
>     Darin: Why not default on?
>     Peter: If asserts default off, we can add asserts to code that
currently
>            doesn't have asserts, without changing things for existing
users.

Something like that, yes, but in addition:

Peter: Asserts default on lead to less assert use since they are no longer
'free' but need a cost/benefit analysis. See current Boost state. In
particular, Beman's general opinion is that checks should be on by default
but smart_ptr.hpp doesn't have checks.

> While I understand this argument, I am not convinced. If it was up to me,
I
> would still have the asserts default on, as with the C standard
<assert.h>.

It's a difficult decision in general.

--
Peter Dimov
Multi Media Ltd.


Info: http://www.boost.org  Unsubscribe: <mailto:boost-unsubscribe@yahoogroups.com>

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/