
22 Jun
2006
22 Jun
'06
11:50 a.m.
On 06/21/2006 09:36 AM, Larry Evans wrote:
How can the attached code be modified to find expected_t0 in expected_args? [snip] typedef mpl::arg<1> expected_t0; typedef mpl::arg<2> expected_t1; typedef mpl::vector<expected_t0,expected_t1> expected_args; typedef mpl::find<expected_args,expected_t0>::type find_t0; Use find_if with predicate arg: same_arg_as<1>
where: template<int I> struct same_arg_as { template< typename T2 > struct apply { typedef typename is_same<mpl::arg<I>,T2>::type type; }; };