Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2006-01-23 19:51:38


"Tobias Schwinger" wrote
> Andy Little wrote:

[...]

>> What should be done about it. Should someone start reporting this to the
>> folks
>> at Microsoft or what?
>>
>
> Definitely. But we should first minimize the case and try to find out what
> exactly
> causes VC8 to turn off ADL (the same situation probably also activates bug1,
> above).
>
> How does the declaration of your operator- look like?

Here's operator +. (All operators fail in a similar way )

namespace boost{namespace pqs{

template <
        typename AbstractQuantity ,
        typename UnitsL ,
        typename Value_typeL ,
        typename UnitsR ,
        typename Value_typeR
>
    inline
    typename meta::binary_operation<
        t1_quantity<
            AbstractQuantity ,
            UnitsL ,
            Value_typeL
> ,
        meta::plus ,
        t1_quantity<
            AbstractQuantity ,
            UnitsR ,
            Value_typeR
>
>::type
    operator + (
        t1_quantity<
            AbstractQuantity ,
            UnitsL ,
            Value_typeL
> const & lhs ,
        t1_quantity<
            AbstractQuantity ,
            UnitsR ,
            Value_typeR
> const & rhs
 )
 {
        typename meta::binary_operation<
            t1_quantity<
                AbstractQuantity,
                UnitsL ,
                Value_typeL
> ,
            meta::plus ,
       t1_quantity<
                AbstractQuantity ,
                UnitsR ,
                Value_typeR
>
>::type result = lhs;
        result += rhs;
        return result;
    }
}}

Heres one example. >
> Does it instantiate templates that use sizeof- or conditional tricks (as
> BOOST_TYPEOF_TPL does)?

The pqs::meta::binary_operation result_type scheme in the operator+ definition
above uses SFINAE quite heavily though. I shall try reducing it to a minimal
example.
Boost.Typeof use in the implementation (for operations on built-in types) is
optional
though I havent tried turning it off yet

[... workaround]

Ok I have opted to define in global namespace currently.

regards
Andy Little


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk