Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > nested templating

Reply
Thread Tools

nested templating

 
 
Matt Davis
Guest
Posts: n/a
 
      05-17-2004
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
 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      05-17-2004
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
 
Reply With Quote
 
 
 
 
John Harrison
Guest
Posts: n/a
 
      05-17-2004

"Matt Davis" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Aquestion about base page class and templating Showjumper ASP .Net 0 02-03-2004 11:59 PM
Templating technique Patrick Kristiansen ASP .Net 1 01-26-2004 06:19 AM
Page templating question Showjumper ASP .Net 3 01-22-2004 03:11 AM
Page Templating in ASP.NET Frank Rizzo ASP .Net 1 01-19-2004 08:20 PM
html templating advice. lloyd christopher Perl 2 10-22-2003 10:39 PM



Advertisments