The following code generates a compile error in Xcode:
template struct Foo { Foo(T Value) { } }; int main() { Foo MyFoo(123);
In C++11 you can use decltype:
decltype
int myint = 123; Foo MyFoo(myint);