This patch updates <type_traits> to use builtins wherever possible. This patch should increase performance greatly. When I compiled all the type traits tests before and after, I saw a 6.6% decrease in build time.
There are a few traits who's corresponding builtins do not work properly. See the comments in code. We will have to enable these traits only after a particular version of clang where the issue has been fixed.
Nice idea. Is this conforming? Consider this somewhat-contrived example:
template<typename T> struct A { void f(is_same<T, int>) {} void f(is_same<T, float>) {} void f(false_type) {} void g() { f(disjunction<is_same<T, int>, is_same<T, float>, false_type>()); } };With a class template is_same, g() calls the version of f corresponding to the "right" option, but with the alias template version, instantiating A<T> is ill-formed because multiple signatures of f collide.