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. Advertisements

  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. Advertisements

  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. Advertisements

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:
    587
    lloyd christopher
    Oct 22, 2003
  2. Russ Perry Jr
    Replies:
    2
    Views:
    5,098
    Russ Perry Jr
    Aug 20, 2004
  3. Chad E. Dollins
    Replies:
    3
    Views:
    885
    Kai-Uwe Bux
    Nov 8, 2005
  4. request@no_spam.com
    Replies:
    5
    Views:
    665
  5. Ultrus
    Replies:
    3
    Views:
    616
    Stefan Behnel
    Jul 9, 2007
  6. Replies:
    3
    Views:
    715
    Victor Bazarov
    Dec 7, 2007
  7. michael greenly

    turn nested hashes into nested ostructs

    michael greenly, Dec 31, 2007, in forum: Ruby
    Replies:
    0
    Views:
    247
    michael greenly
    Dec 31, 2007
  8. Richard A. DeVenezia

    Nested function X vs. nested varX = function

    Richard A. DeVenezia, Sep 8, 2003, in forum: Javascript
    Replies:
    1
    Views:
    245
    Code Ronin
    Sep 9, 2003
Loading...