Boost logo

Boost :

Subject: Re: [boost] BOOST_STATIC_CONSTANT
From: Glen Fernandes (glen.fernandes_at_[hidden])
Date: 2017-08-17 01:27:12


On Wed, Aug 16, 2017 at 7:22 PM, Vladimir Batov wrote:
> BOOST_TEST(true == boost::impl_ptr<Shared>::value);
> BOOST_TEST(true == boost::impl_ptr<Shared const>::value);
>
> The only difference between them is "const". However, when I compile with
> clang-4.0, the second (const) line passes. However, the first one fails! I
> refuse to believe it's a clang glitch. It must be me doing something really
> stupid. Help?!
>

This is to detect a member 'impl_ptr_type' type? Just:

    template<class, class = void>
    struct has_impl_ptr_type
        : boost::false_type { };
    template<class T>
    struct has_impl_ptr_type<T, boost::void_t<typename T::impl_ptr_type> >
        : boost::true_type { };

Glen


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