|
Boost Users : |
Subject: [Boost-users] enable_if help
From: John Dlugosz (JDlugosz_at_[hidden])
Date: 2010-04-13 19:34:34
I need to amend my last post (which I can't reply to since it's not showing up on the list yet). The operator+ example doesn't work either. I just didn't notice since it uses +=. I realized that after I posted, and tried testing that separately.
However, it gives a different error. It's a more ordinary "no operator found which takes..." which is typical of getting the enable_if wrong so it's not enabled or arguments can't be deduced.
So now I'm wondering if the trouble is the and/or. I had assumed that the true_type/false_type were compatible between MPL and the native TR1, since it boils down to "type" and "value". But now I'm thinking that the templates work by mentioning those specific classes.
The enable_if and disable_if have proven to work with the native TR1 tests and my own which use the native true/false_type. So I assumed that precautions were taken to interoperate. Maybe the same isn't true with and_ and or_ ?
The underlying issue is that TR1 took much of type_traits, but not the composition of primitives. Plauger appears to have an "and" he uses internally, but no "or".
If you think that's the trouble, is there something like the _c form that might work with the underlying types? Or maybe I'm barking up the wrong tree; after all, enable_if works fine.
--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.
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