AMDG Olivier Tournaire wrote:
I am currently trying to write a simple functor, and I would like to have the same overload for the operator () for all types in a mpl::vector.
<snip>
struct any_view_min_max { typedef std::pair
result_type; template <typename View> result_type operator()(const View& v) const { typedef typename View::iterator iterator; std::pair< iterator, iterator > result = boost::minmax_element( v.begin() , v.end() , pixel_compare_less() ); return std::make_pair( *(result.first) , *(result.second) ); } };
This works fine for 'gray_image_types', but need to be specialized for types in rgb_image_types. The specialization is the same, so, I am looking for an automated way to do this. "Manually", I can write this:
<snip>
You can define two overloads of operator() and use enable_if to distinguish them. In Christ, Steven Watanabe