Boost logo

Boost Users :

From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2006-11-02 12:53:01


Hi, Dave!

I suggest to have some concept checks for integral template parameters. What if I which to check
at compile time that an integer value passed to template is greater 0. I can do this with
BOOST_MPL_ASSERT or I could use some descriptive concept check like stated below.

With Kind Regards,

Ovanes Markarian

On Thu, November 2, 2006 19:43, David Abrahams wrote:
> "Ovanes Markarian" <om_boost_at_[hidden]> writes:
>
>> Hi!
>>
>> Thanks for the great library. Currently I have to deal with
>> constants as template parameters and I wonder, why there is no
>> library to model constant concepts. Like:
>>
>>
>> template<class T, size_t MAX_SIZE>
>> struct Allocator
>> {
>> Allocator()throw();
>> };
>>
>>
>> template<class T, size_t MAX_SIZE>
>> Allocator<T,MAX_SIZE>::Allocator()throw()
>> {
>> boost::function_requires<ConstGreaterThen<MAX_SIZE,O> >();
>> }
>>
>>
>> I understand I could model it with BOOST_MPL_ASSERT etc. But would not it be better to unite all
>> these features in one lib?
>
> I'm not sure what you're suggesting, sorry.
>
> --
> Dave Abrahams
> Boost Consulting
> www.boost-consulting.com
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


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