Hi, I have few Adapter classes. Each of them provide typedef operations which specifies which operations that Adapter supports (vector_c, with 0 or 1 at appropriate positions). I want to assert that two Adapters support different operations. However, my code doesn't compile. Any ideas? Daniel template<unsigned int N1, unsigned int N2> struct Adapter { typedef vector_c<unsigned int, N1, N2> operations; }; template<class TAdapter1, class TAdapter2> struct Check { typedef typename transform< typename TAdapter1::operations, typename TAdapter2::operations, plus<_1, _2> >::type sum_of_operations; typedef typename max_element<sum_of_operations>::type max_of_operations; BOOST_MPL_ASSERT((less_equal<max_of_operations, int_<1> >)); }; int main() { Check< Adapter<0, 1>, Adapter<1, 0> >(); return 0; }
Daniel <boost@poradnik-webmastera.com> writes:
Hi, I have few Adapter classes. Each of them provide typedef operations which specifies which operations that Adapter supports (vector_c, with 0 or 1 at appropriate positions). I want to assert that two Adapters support different operations. However, my code doesn't compile. Any ideas?
Can you post your error messages? -- Dave Abrahams Boost Consulting www.boost-consulting.com
participants (2)
-
Daniel
-
David Abrahams