From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2002-04-29 15:28:49


Inspired by your example and in search of is_const_copy_constructable
validation I wrote the following

namespace validation {

template <typename T>
struct is_const_copy_constructable
{
 static char helper( T, T );
 static float helper( T const&, T const& );
 static const T t1;
 static T t2;

 enum { value = (sizeof( helper(t1,t2) ) == sizeof(char))};
};

}

struct A { A(A&); };
struct B {};

char test4[validation::is_const_copy_constructable<A>::value];

For some reasons it worked for MSVC6sp5, but does not work on online Cameau.
Who is right?

Gennadiy.