Boost logo

Boost Users :

Subject: Re: [Boost-users] [review][constrained_value] Review of Constrained Value Library begins today
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2008-12-04 11:46:52


Edward Diener wrote:

> Suppose the value is provided by the end user of the program.

Then the programmer should check its value before assigning it into the
constrained type, like I just said.
A constrained type is just a type that must maintain an invariant, and
it should be up to the programmer to ensure that the necessary
preconditions for the invariant are always met, and assertions are here
to help him do just that.

> A large part of the constrained value concept is that the constraint
> provides the necessary checking, in the form of a policy, which
> alleviates specific pre-checking by the programmer. I like that, else
> the constraint library serves less purpose than it could.

To me, that makes it useless, because that's adding runtime checks where
it is not always needed, potentially adding quite some overhead.
At least it's configurable, but the default behaviour isn't the right
one IMO.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net