creating a list of lists

Discussion in 'C++' started by Uwe Ziegenhagen, Aug 12, 2003.

  1. Hi folks,

    one question:

    I try to create a list of lists, using

    std::list<std::list> testlist;

    but BCC 6 complains:

    cannot generate template-specialization from __STL::list<_Tp,_Alloc>

    How ist it done coreectly? My knowledge of C++ is still growing...


    Uwe
     
    Uwe Ziegenhagen, Aug 12, 2003
    #1
    1. Advertising

  2. Uwe Ziegenhagen wrote:
    > Hi folks,
    >
    > one question:
    >
    > I try to create a list of lists, using
    >
    > std::list<std::list> testlist;
    >
    > but BCC 6 complains:
    >
    > cannot generate template-specialization from __STL::list<_Tp,_Alloc>
    >
    > How ist it done coreectly? My knowledge of C++ is still growing...
    >
    >
    > Uwe
    >


    just found out:

    std::list<std::list<double> > testlist;

    uwe
     
    Uwe Ziegenhagen, Aug 12, 2003
    #2
    1. Advertising

  3. "Uwe Ziegenhagen" <-berlin.de> wrote...
    > one question:
    >
    > I try to create a list of lists, using
    >
    > std::list<std::list> testlist;
    >
    > but BCC 6 complains:
    >
    > cannot generate template-specialization from __STL::list<_Tp,_Alloc>
    >
    > How ist it done coreectly? My knowledge of C++ is still growing...


    You want to create a list of lists of WHAT? For example,
    a list of lists of integers is created this way:

    std::list<std::list<int> > listoflistsofints;

    Victor
     
    Victor Bazarov, Aug 12, 2003
    #3
  4. Uwe Ziegenhagen

    Mike Wahler Guest

    Uwe Ziegenhagen <-berlin.de> wrote in message
    news:bhbb7s$90i$-berlin.de...
    > Hi folks,
    >
    > one question:
    >
    > I try to create a list of lists, using
    >
    > std::list<std::list> testlist;


    'std::list' requires a template argument.
    The second one doesn't have one.

    >
    > but BCC 6 complains:
    >
    > cannot generate template-specialization from __STL::list<_Tp,_Alloc>
    >
    > How ist it done coreectly? My knowledge of C++ is still growing...


    std::list<std::list<type> > a_list_of_lists;

    -Mike
     
    Mike Wahler, Aug 12, 2003
    #4
    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. Fuzzyman

    Creating a List of Empty Lists

    Fuzzyman, Dec 4, 2003, in forum: Python
    Replies:
    27
    Views:
    663
    Duncan Booth
    Dec 9, 2003
  2. =?UTF-8?B?w4FuZ2VsIEd1dGnDqXJyZXogUm9kcsOtZ3Vleg==

    List of lists of lists of lists...

    =?UTF-8?B?w4FuZ2VsIEd1dGnDqXJyZXogUm9kcsOtZ3Vleg==, May 8, 2006, in forum: Python
    Replies:
    5
    Views:
    410
    =?UTF-8?B?w4FuZ2VsIEd1dGnDqXJyZXogUm9kcsOtZ3Vleg==
    May 15, 2006
  3. yomgui

    list of lists of lists ....

    yomgui, Jul 28, 2006, in forum: Python
    Replies:
    6
    Views:
    315
    yomgui
    Jul 31, 2006
  4. bahoo
    Replies:
    3
    Views:
    303
    Bruno Desthuilliers
    Apr 3, 2007
  5. antar2
    Replies:
    2
    Views:
    393
    Bighead
    Jul 17, 2008
Loading...

Share This Page