Re: [Boost-users] [review][constrained_value] Review of ConstrainedValue Library begins today
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@lists.boost.org To: boost-users@lists.boost.org Cc: boost@lists.boost.org ReplyTo: boost-users@lists.boost.org 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@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users Sent from my Verizon Wireless BlackBerry
participants (1)
-
raindog@macrohmasheen.com