
On Mon, 17 May 2004 10:51:19 -0400, christopher diggins wrote
Would it be acceptable that I post on my web site: http://www.cdiggins.com/constrained_value.hpp until we arrive at consensus, at which i point I submit it to the sandbox?
No problem, it's just that we will probably get this developed and then we will have to wait awhile for a review slot. In the meantime it's easier to do a cvs checkout for various updates and such. But seriously, there's no rush...
I too like the idea of a validation policy. You propose an interesting technique but I am not convinced it is the best option for what we want. If constraints_policy does the validation then the error handling policy could just more easily be passed as an argument to the constraints policy.
Yep, I agree.
This leaves us with:
template< class constraints_policy, bool implicit_conversion_policy = true> class constrained_value { ... }
But I think you the 'min' and 'max' function requirement is now out of place on the core template. If you have a constrained range, then it makes sense, but if I'm checking for 'divisible by 4' then I'll be perplexed as to why I have to provide min and max in my constraints_policy class. However, if you derive from the constraints_policy it can provide any interfaces it wants to the user. Jeff