Is there a standard construct for 'select <bool, typename, typename>'?
I sometimes need the following:
template<bool B, typename T1, typename T2>
struct choose{
typedef T1 type;
};
template<typename T1, typename T2>
struct choose<false, T1, T2>{
typedef T2 type;
};
I use this to conditionally select one or the other type. Now, is there anything in the standard library that does just that? Boost.MPL has something similar , but it's not quite the same (takes a type, not a bool), and I don't want to enable Boost for this little thing. :)
+3