Currently in<functional> we have this helper class to constrain the
std::bind function template via SFINAE:
template<typename _Tp>
class __is_socketlike
{
typedef typename decay<_Tp>::type _Tp2;
public:
static const bool value =
is_integral<_Tp2>::value || is_enum<_Tp2>::value;
};
I was going to replace the static member with:
static const bool value = __or_<is_integral<_Tp2>, is_enum<_Tp2>>::value;
But now that we have alias templates I'm wondering if it would be
better to write it as:
template<typename _Tp>
using __is_socketlike
= __or_<is_integral<typename decay<_Tp>::type>,
is_enum<typename decay<_Tp>::type>>;
Does the implementation in G++ mean that using an alias template
avoids instantiating the separate __is_socketlike class template, or
is there just as much cost in instantiating an alias template as a
class template?