-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of vicente.botet Sent: Monday, April 26, 2010 1:26 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] enable-if overloading out the wazoo
----- Original Message ----- From: "John Dlugosz"
To: Sent: Friday, April 23, 2010 10:31 PM Subject: [Boost-users] enable-if overloading out the wazoo I tried something like this: First, the general form in one header
known by everything:
template
dim_s foo (const T1& left, const T2& right); Then, in a header that gets more concrete, provide its own form that
is meant to be used when objects of those types are involved:
template
typename enable_if_c< is_base_of ::value && is_base_of ::value, dim_s>::type foo (const T1& left, const T2& right); What about overloading with the genericbase class?
dim_s foo (const genericbase& left, const genericbase& right);
Am I missing something?
Best, Vicente
The plain overloaded function will be a worse match than the first template form I showed, which is always an exact match for all types. It won't get used. --John 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.