howto find arg<i> in vector of arg<j>'s?

21 Jun
2006
21 Jun
'06
2:36 p.m.
How can the attached code be modified to find expected_t0 in expected_args? TIA.

22 Jun
22 Jun
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; }; };
6932
Age (days ago)
6933
Last active (days ago)
1 comments
1 participants
participants (1)
-
Larry Evans