Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-04-26 18:55:05


Mike Conley <conley.141_at_[hidden]> writes:

> David Abrahams <dave_at_[hidden]> wrote in
> news:uof2t8b4v.fsf_at_[hidden]:
>
>> This one is sticky.
>>
>> class Y : X { true_type f() { return is_convertible<Y,X>::type();
>> } }; false_type x = is_convertible<Y,X>::type();
>>
>
> I'm not sure I see the problem here. If is_convertible is a built in
> compile time operator, the results should depend upon context. This should
> work as expected. Really, it's no more interesting than:
>
> char c[23];
> cout << sizeof(c);
> {
> char c[22];
> cout << sizeof(c);
> }
>
> printing 2322.

What about the ODR?

Further, suppose I write a metafunction:

        template <class T>
        struct is_const_and_int_convertible
           : and_<
                 is_const<T>
               , is_convertible<T,int>
>
         {};

Does this one depend on context also?
                  

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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