even one more template question

Discussion in 'C++' started by Tony Johansson, Aug 15, 2005.

  1. Hello experts!

    Can somebody give me some example when this Stack<List<T> > s;
    is used. I do know what this Stack<int> s; and this means List<int> l;

    Many thanks

    //Tony
     
    Tony Johansson, Aug 15, 2005
    #1
    1. Advertising

  2. Tony Johansson wrote:
    > Can somebody give me some example when this Stack<List<T> > s;
    > is used. I do know what this Stack<int> s; and this means List<int> l;


    The type

    Stack<List<whatever> >

    would be used when you need a stack of lists of whatever. If you don't
    need a stack of lists, don't use it.

    Get yourself a book on data structures and algorithms. In it you might
    come across a vector of lists or a hash map of stacks or something like
    that. Such combinations are probably an order of magnitude (or more)
    rarer than "regular" containers. The most frequent I've used was probably
    vector<vector<something> >.

    V
     
    Victor Bazarov, Aug 15, 2005
    #2
    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. Stan Goodman

    Even older fart, even newer newbie

    Stan Goodman, Jul 3, 2003, in forum: Java
    Replies:
    11
    Views:
    703
    Stan Goodman
    Jul 4, 2003
  2. Michael
    Replies:
    4
    Views:
    419
    Matt Hammond
    Jun 26, 2006
  3. Merciadri Luca
    Replies:
    4
    Views:
    822
  4. Steven D'Aprano
    Replies:
    0
    Views:
    99
    Steven D'Aprano
    Dec 23, 2013
  5. Replies:
    3
    Views:
    89
    Gary Herron
    Dec 23, 2013
Loading...

Share This Page