Suppose I have an object that has a member variable that is of some template type. So, in the declaration of the class, there would be something like this:
// This is just the declaration of bar which is a member of some class.
templatizedType<Foo> bar;
Now, when I want to initialize bar
why do I have to do
// This is the initialization. Note that I am assuming that templatizedType has a
// constructor that takes an argument of type T*. Presumably, this is happening
// somewhere inside whatever class has declared bar as a member.
templatizedType<Foo> bar(new Foo());
instead of simply
bar(new Foo());
EDIT(trying to clarify): Essentially, it seems to me that the type of bar (including the parametrized type) is already spelled out in it's declaration as a member of the class and thus should not require a repeat upon initialization.
If none of this makes sense, let me know (I discovered this mostly through trial-and-error and some helpful people on IRC, so if my understanding of what is going on here is wrong, help with that would also be greatly appreciated.)