Boost logo

Boost Users :

Subject: Re: [Boost-users] [review][constrained_value] Review of ConstrainedValue Library begins today
From: Robert Kawulak (robert.kawulak_at_[hidden])
Date: 2008-12-05 06:27:45


Hi Jesse,

> In practice, you are changing the bounds here prior to creating instances of
an item. It is purely a question of being able to dynamically create bounds for
a type and then query them later...

OK, now it makes a bit more sense. Moreover, I believe it is possible (though
maybe not trivial) to implement something similar with the current library.

> Otherwise if std::max was written to take two different types with compatible
comparison operators, that this could work fine?

You may have a look at
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2199.html -- it tries
to overcome the problem for min/max, but still the problem remains for any
template function with arguments of the same type.

> And if the constrained_value<double> had an implicit conversion to double,
then we would have no problem?

You mean, with std::max? We would have exactly the same problem.

Best regards,
Robert


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