Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2005-11-16 13:44:14


Cory Nelson <phrosty_at_[hidden]> writes:

> Is there any way to validate a predicate (function, functor etc)
> template with MPL?
>
> ie, something like:
>
> BOOST_MPL_ASSERT((and_<
> is_function<Predicate>,
> equal_to<function_traits<Predicate>::arity, int_<1> >,
> is_same<function_traits<Predicate>::result_type, int >,
> is_same<function_traits<Predicate>::arg1_type, int >
>>));

I don't know what you mean by "validate," but your assertion above
looks like reasonable code to me.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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