constrained_value: 1 more question

Is it really intentional that the error handling of constrained & operator = (const value_type & v) uses BOOST_ASSERT(_check_value()); But in void _initialize() it uses throw_exception<>()(_value, _value, _constraint());

From: Neal Becker Is it really intentional that the error handling of constrained & operator = (const value_type & v)
uses BOOST_ASSERT(_check_value());
But in void _initialize()
it uses throw_exception<>()(_value, _value, _constraint());
It was intentional, so it's impossible to construct constrained object with broken invariant even with error policy that ignores invalid values. However, the current version I'm working on has asserts everywhere, and there's a requirement added for error policy that it cannot return and leave an object in an invalid state. Best regards, Robert
participants (2)
-
Neal Becker
-
Robert Kawulak