conditionally enabling constructor
- by MK
Here is how I can conditionally enable a constructor of a class :
struct Foo
{
template<class T>
Foo( T* ptr, boost::enable_if<is_arithmetic<T> >::type* = NULL )
{}
};
I would like to know why I need to do the enabling via a dummy parameter. Why can I not just write :
struct Foo
{
template<class T>
Foo( boost::enable_if<is_arithmetic<T>, T>::type* = NULL )
{}
};