Boost logo

Boost :

Subject: Re: [boost] [Boost-users] [review][constrained_value] Review of ConstrainedValue Library begins today
From: raindog_at_[hidden]
Date: 2008-12-03 23:07:23


I totally agree. Pre contstraining a value for assignment to constrained_value seems to defeat the purpose of the library all together.

------Original Message------
From: Edward Diener
Sender: boost-users-bounces_at_[hidden]
To: boost-users_at_[hidden]
Cc: boost_at_[hidden]
ReplyTo: boost-users_at_[hidden]
Sent: Dec 3, 2008 7:58 PM
Subject: Re: [Boost-users] [review][constrained_value] Review of ConstrainedValue Library begins today

Mathias Gaunard wrote:
> Edward Diener wrote:
>
>> I disagree with your analysis. The '26' value could be a run-time
>> calculation and not just a compile-time constant. In which case you
>> are saying that the assignment of a run-time calculation should assert
>> only when run in debug mode and otherwise should be ignored. I can not
>> agree with that idea.
>
> I say it is up to the programmer to ensure valid values are provided.
> If the value is only known at runtime, there should be explicit checking
> in the code prior to assignment.

Suppose the value is provided by the end user of the program. Do you
still feel such a value, when used in a constraint, should assert only
in debug mode rather than throw an exception ?

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.

_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users




Sent from my Verizon Wireless BlackBerry


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk