
Hi,
initialize() - returns a value used to default-initialize a constrained object;
It seems that you'd want it to take a non-const reference to avoid copying.
I'm afraid i don't understand what you mean...
BTW in the current version I've changed the name of basic_bounded template to constrained_type (I don't like constrained_value name which may be misleading, because it's a type of values rather than a value itself), and
I'm confused. I thought the whole point of your library was to create an object that *has* a value and to constrain that value to be a member of a prescribed set. That's how you can add them together, increment them, etc. Thus, "constrained_value" is exactly the right name.
Putting it simply, point of my library is to provide templates of classes of objects having a value conforming to given constraints. constrained_type (or whatever we'll call it) is a type (class template to be strict), how can a type be named "something_value"? Now that's confusing to me... Maybe constrained_values_type would be the most appropriate ;-)
Given that, you do need to implement, though not necessarily through the policy class, the arithmetic assignment operators, and everything else that will make these act like built-in types.
Actuallny I did, all the mutating operators are overloaded: increment/decrement use adequate policy functions, and the rest (all the @= operators) use policy member assign(). Best regards, Robert