Sorry for the dealy I was trying to find the time to check the libc++ and stdlibc++ stuff but haven't found a moment yet. This is what I've got, but I think you'd need to tweak it, as I'm not sure whats the best way to test for libc++ or stdlibc++, currently I'm just falling back on the fact that if all the other CPP11 macro code doesn't pass then treat it as clang with libc++.
template<typename T>
asUINT asGetTypeTraits()
{
#if defined(LIBSTDCPP11) || defined(OTHERCPP11)
bool hasConstructor = std::is_default_constructible<T>::value && !std::has_trivial_default_constructor<T>::value;
#else
bool hasConstructor = std::is_default_constructible<T>::value && !std::is_trivially_default_constructible<T>::value;
#endif
#if defined(LIBSTDCPP11)
bool hasDestructor = std::is_destructible<T>::value && !std::is_trivially_destructible<T>::value;
#elsif defined(LIBCPP11)
bool hasDestructor = std::is_destructible<T>::value && !std::is_trivially_destructible<T>::value;
#else
bool hasDestructor = std::is_destructible<T>::value && !std::has_virtual_destructor<T>::value;
#endif
#if defined(LIBSTDCPP11) || defined(OTHERCPP11)
bool hasAssignmentOperator = std::is_copy_assignable<T>::value && !std::has_trivial_copy_assign<T>::value;
bool hasCopyConstructor = std::is_copy_constructible<T>::value && !std::has_trivial_copy_constructor<T>::value;
#else
bool hasAssignmentOperator = std::is_copy_assignable<T>::value && !std::is_trivially_copy_assignable<T>::value;
bool hasCopyConstructor = std::is_copy_constructible<T>::value && !std::is_trivially_copy_constructible<T>::value;
#endif
bool isFloat = std::is_floating_point<T>::value;
bool isPrimitive = std::is_integral<T>::value || std::is_pointer<T>::value || std::is_enum<T>::value;
bool isClass = std::is_class<T>::value;
bool isArray = std::is_array<T>::value;
if( isFloat )
return asOBJ_APP_FLOAT;
if( isPrimitive )
return asOBJ_APP_PRIMITIVE;
if( isClass )
{
asDWORD flags = asOBJ_APP_CLASS;
if( hasConstructor )
flags |= asOBJ_APP_CLASS_CONSTRUCTOR;
if( hasDestructor )
flags |= asOBJ_APP_CLASS_DESTRUCTOR;
if( hasAssignmentOperator )
flags |= asOBJ_APP_CLASS_ASSIGNMENT;
if( hasCopyConstructor )
flags |= asOBJ_APP_CLASS_COPY_CONSTRUCTOR;
return flags;
}
if( isArray )
return asOBJ_APP_ARRAY;
// Unknown type traits
return 0;
}
I found this http://clang.llvm.org/docs/LanguageExtensions.html#feature_check, which seems to imply that these macros can be used across platforms (Which doesn't really solve the problem as there function names are different anyway.).
LIBSTDCPP11 would be __GNUC__