Intrinsics for N2965: Type traits and base classes

Jason Merrill jason@redhat.com
Fri Oct 14 15:49:00 GMT 2011


On 10/13/2011 01:35 PM, Michael Spertus wrote:
> +int main() {
> +  assert(typeid(b<F>::type)
> +         == typeid(types<A,C,D,A,C,D,B,C,C,D,B,E>));
> +  assert(typeid(db<F>::type) == typeid(types<A,B,E>));
> +  assert(typeid(db<int>::type) == typeid(types<>));
> +  return 0;
> +}

Let's make this a compile-time test using something like

template <class,class> struct assert_same_type;
template <class T> struct assert_same_type<T,T> {};

Jason



More information about the Libstdc++ mailing list