Boost logo

Boost :

Subject: Re: [boost] BOOST_STATIC_CONSTANT
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2017-08-17 01:33:03


On 17/08/2017 12:45, Vladimir Batov wrote:
> Thanks, Gavin. Is it how it is done these days? Nice. Incorporated. Many
> thanks... clang still fails... now I am starting to look suspiciously in
> clang's direction.

FYI, the complete program:

#include <type_traits>

template <typename T>
class has_impl_ptr_type
{
     template <typename T1>
     static typename T1::impl_ptr_type test(int);
     template <typename>
     static void test(...);
public:
     enum { value = !std::is_void<decltype(test<T>(0))>::value };
};

struct A
{
};

struct B
{
     typedef int impl_ptr_type;
};

static_assert(!has_impl_ptr_type<A>::value, "");
static_assert( has_impl_ptr_type<B>::value, "");
static_assert( has_impl_ptr_type<B const>::value, "");

int main() { return 0; }

Compiles successfully for me with -std=c++11 on gcc 5.4.0 and clang
3.8.0, as well as VS2015.

So unless this is some kind of regression in clang-4, your problem
probably lies elsewhere.


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