There is something seemingly basic that puzzles me greatly. I am hoping
people might clarify something I totally fail to understand.
I've been using BOOST_STATIC_CONSTANT for ages (with GCC). Now I have
something seemingly non-controversial:
template<typename user_type>
struct impl_ptr
{
using yes_type = boost::type_traits::yes_type;
using no_type = boost::type_traits::no_type;
using ptr_type = typename std::remove_const::type*;
template<typename Y>
static yes_type test (Y*, typename Y::impl_ptr_type* =nullptr);
static no_type test (...);
BOOST_STATIC_CONSTANT(bool, value = (1 ==
sizeof(test(ptr_type(nullptr)))));
};
When compiled with gcc-.5.4.0, both lines below pass:
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?!