
AMDG John Dlugosz wrote:
I'm getting tons of this from Microsoft's compiler:
error C2893: Failed to specialize function template 'enable_if
Without the actual error message, I'm not sure I can help much.
but isn't that the whole point of using enable_if? I'm using it already in my project and understand the idea behind it.
Here is the function in question:
template
typename enable_if< boost::mpl::and_< std::tr1::is_base_of , boost::mpl::or_< is_dimensional_time<D>, std::tr1::is_same , std::tr1::is_same > >, T>::type& operator+= (T& left, const D& right) { left.addop_ (right); // real implementation is in the generic base class return *this; // but I need this template to return the correct derived (actual) class. }
This can't be the real code, because it wouldn't compile as a member because it takes two arguments, and wouldn't compile as a non-member, because it uses "this." In Christ, Steven Watanabe