nested templating

Discussion in 'C++' started by Matt Davis, May 17, 2004.

  1. Matt Davis

    Matt Davis Guest

    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
     
    Matt Davis, May 17, 2004
    #1
    1. Advertising

  2. 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
     
    Victor Bazarov, May 17, 2004
    #2
    1. Advertising

  3. "Matt Davis" <> wrote in message
    news:...
    > 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
     
    John Harrison, May 17, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. lloyd christopher

    html templating advice.

    lloyd christopher, Oct 22, 2003, in forum: Perl
    Replies:
    2
    Views:
    472
    lloyd christopher
    Oct 22, 2003
  2. Frank Rizzo

    Page Templating in ASP.NET

    Frank Rizzo, Jan 19, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    335
    Maxim V. Karpov
    Jan 19, 2004
  3. Showjumper

    Page templating question

    Showjumper, Jan 22, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    305
    Steve C. Orr [MVP, MCSD]
    Jan 22, 2004
  4. Patrick Kristiansen

    Templating technique

    Patrick Kristiansen, Jan 24, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    344
    Natty Gur
    Jan 26, 2004
  5. Showjumper
    Replies:
    0
    Views:
    312
    Showjumper
    Feb 3, 2004
Loading...

Share This Page