Boost logo

Boost :

Subject: Re: [boost] is_convertible problems associated with move-only types
From: John Maddock (john_at_[hidden])
Date: 2009-01-06 04:53:41


> The intent is that in boost::is_convertible<From, To> From is now
> considered an rvalue (unless From is a (lvalue) reference type). This
> makes my test case happy. I can now move construct a unique_ptr with a
> move-only deleter.
>
> Fwiw, this definition of is_convertible is consistent with
> std::is_convertible in N2800:
>
>> In order to instantiate the template is_convertible<From, To>, the
>> following code shall be well formed:
>>
>> template <class T>
>> typename add_rvalue_reference<T>::type create();
>> To test() {
>> return create<From>();
>> }
>>
>> [ Note: This requirement gives well defined results for reference types,
>> void types, array types, and function types. -- end note ]
>
>
> I've got a much more refined unique_ptr testsuite on the way which will
> contain the unique_ptr header and test case for this (not there yet, I'll
> post when it is).

Howard, have you checked that this doesn't break any of the existing
type_traits tests? If not can you let me have one (or more!) test cases for
the problem so I can work on patching is_convertible here?

Thanks, John.


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