
2 Sep
2011
2 Sep
'11
2:40 a.m.
Hi everyone, Once past the basic understanding of C++ metaprogramming (factorial, vector/typeslist, .), I must confess I have a hard time using max_element in my particular scenario. And I have not found a lot of samples on the net. Consider this "repro" first: template <unsigned char L> struct Level { static const unsigned char value = L; }; template <class LEVEL> struct CTA { typedef LEVEL Level_t; }; typedef boost::fusion::vector<CTA1, CTA2, CTA3, CTA4> CTAS; Now, using max_element, I'd like to pick the one CTAn for which CTn::Level_t::value is the biggest. Can you enlighten me? Thanks! An MPL/FUSION beginner. J