
I'm getting tons of this from Microsoft's compiler:
error C2893: Failed to specialize function template 'enable_if

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

-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Steven Watanabe Sent: Tuesday, April 13, 2010 8:06 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] Please help with enable_if problem
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.
error C2893: Failed to specialize function template 'enable_if
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."
Ah, yes, the code is wrong. Normally I'll start to see errors in the body as normal errors once it instantiates. Changing the line to "return left;" doesn't change the error. TradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
participants (2)
-
John Dlugosz
-
Steven Watanabe