
----- Original Message ----- From: "Rob Stewart" <stewart@sig.com> [snip]
That is a problem, but so too is the increasing pain of specifying a desireable combination of policies. What about using a single policy argument with everything combined? That means you can use a single class (template) or use a class template that permits specifying various pieces -- not unlike shown above -- into one class that can be the constrained_value parameter.
The advantage of this approach is that it gives the policy authors greater flexibility. They can write monolithic policy classes, if desireable. They can assemble a class template that gives select configurability or one that makes it possible to supply each policy independently as you've shown. As part of the library, you could even supply the latter class template, so the library would support both extremes out of the box.
I agree. I just posted a latest version at http://www.cdiggins.com/constrained_value.hpp which has only has two policies passed to a constrained_value type, a constraints_policy and an implicit_conversion flag. This flag I believe is best left out of the constraints_policy but I could be convinced otherwise. There is now a small demonstration program at http://www.cdiggins.com/cv_test.hpp which has some example policies. Christopher Diggins http://www.cdiggins.com http://www.heron-language.com