Boost logo

Boost :

Subject: Re: [boost] [type_traits][core] modularisation and moving stuff about (again)
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2018-08-23 11:23:53


On 08/23/18 14:12, Peter Dimov via Boost wrote:
> Andrey Semashev wrote:
>
>> For noncopyable, we could convert its detection from
>> is_base_and_derived to a dispatch based on SFINAE.
>>
>>   // Boost.Core
>>   class noncopyable
>>   {
>>   public:
>>     typedef void _is_boost_noncopyable;
>>   };
>>
>>   // Boost.TypeTraits
>>   template< typename T, typename = void >
>>   struct is_boost_noncopyable : false_type {};
>>
>>   template< typename T >
>>   struct is_boost_noncopyable< T, typename T::_is_boost_noncopyable >
>> : true_type {};
>
> This doesn't work because types derive privately from
> boost::noncopyable, and the trait above returns false in this case.

Does is_base_and_derived (non-intrinsic-based) work with private
inheritance?


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