By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,851 Members | 2,097 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,851 IT Pros & Developers. It's quick & easy.

nested templating

P: n/a
Hello,

I am attempting to create a vector of trees that contain user defined
objects.
For example, the follwing code will not compile.

vector <tree <userObject> > vectorTree;

Is this kind of nested templating allowed in C++? I recoginze that
there must be a space between the angle bracets (to avoid being
mistaken for a stream operator).

Any help would be appreciated.

Matt Davis
Jul 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Matt Davis wrote:
I am attempting to create a vector of trees that contain user defined
objects.
For example, the follwing code will not compile.

vector <tree <userObject> > vectorTree;

Is this kind of nested templating allowed in C++? I recoginze that
there must be a space between the angle bracets (to avoid being
mistaken for a stream operator).


What's "tree"?

V
Jul 22 '05 #2

P: n/a

"Matt Davis" <cm****@hotmail.com> wrote in message
news:4b**************************@posting.google.c om...
Hello,

I am attempting to create a vector of trees that contain user defined
objects.
For example, the follwing code will not compile.

vector <tree <userObject> > vectorTree;

Is this kind of nested templating allowed in C++?
Yes it is allowed.
I recoginze that
there must be a space between the angle bracets (to avoid being
mistaken for a stream operator).

Any help would be appreciated.


Post the code that doesn't compile, in this case that would include the
definitons of tree and userObject. Post the compiler error message.

If you want help you have to supply the information needed to help you. Why
does this stuff have to said time after time?

john
Jul 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.