enable_if method specialization
template<typename T> struct A { A<T> operator%( const T& x); }; template<typename T> A<T> A<T>::operator%( const T& x ) { ... } How can I use enable_if to make the following specialization happen for any floating point type (is_floating_point)? template<> A<float> A<float>::operator%( const float& x ) { ... } EDIT: Here's an answer I came up which is different from the ones posted below... template<typename T> struct A { T x; A( const T& _x ) : x(_x) {} template<typename Q> typename std::enable_if<std::is_same<Q, T>::value && std::is_floating_point<Q>::value, A<T> >::type operator% ( const Q&