auto a = (Foo<T>*)malloc(sizeof(Foo<T>));
auto *b = (Foo<T>*)malloc(sizeof(Foo<T>));
I don’t think it’s important that templates are there, but the question is: are a and b of the same type?
g++ -std=c++0x -Wall (4.4) doesn’t give any errors or warnings, but I haven’t run the program so I don’t know if it does the same thing.
Does this mean that for a, auto is Foo<T>*, but for b, auto is Foo<T>?
Let’s find out, shall we?
This compiles without a static assertion failure.
Yes.