|
Boost Users : |
Subject: Re: [Boost-users] puzzle with enable_if
From: John Dlugosz (JDlugosz_at_[hidden])
Date: 2010-04-20 15:52:41
> -----Original Message-----
> From: boost-users-bounces_at_[hidden] [mailto:boost-users-
> bounces_at_[hidden]] On Behalf Of Gevorg Voskanyan
> Sent: Tuesday, April 20, 2010 1:23 PM
> To: boost-users_at_[hidden]
> Subject: Re: [Boost-users] puzzle with enable_if
>
> "Only invalid types and expressions in the immediate context of the
> function type and its template parameter types can result in a
> deduction failure. [ Note: The evaluation of the substituted types and
OK, so "refactoring" in general won't work. The SFINAE must be directly caused by the template specialization mentioned in the function declaration.
Your case f (struct A contains T::value_type) is a failure of A to specialize. My example where the function returned something derived from A, say struct A2 : A { ..., is not a failure of A2 but of a type needed by it. T::value_type is still a dependant type, I would have thought, but I see that the error is the use of T:: that is a part of A's syntax. The difference is a nested call to have a template instantiated.
Is that the right track?
Thanks,
--John
(footer woes...)
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.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net