Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 05:19 PM
Uwe Ziegenhagen
Guest
 
Posts: n/a
Default creating a list of lists

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

  #2  
Old July 19th, 2005, 05:19 PM
Victor Bazarov
Guest
 
Posts: n/a
Default Re: creating a list of lists

"Uwe Ziegenhagen" <isestd14@wiwi.hu-berlin.de> wrote...[color=blue]
> 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...[/color]

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


  #3  
Old July 19th, 2005, 05:19 PM
Uwe Ziegenhagen
Guest
 
Posts: n/a
Default Re: creating a list of lists

Uwe Ziegenhagen wrote:[color=blue]
> 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
>[/color]

just found out:

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

uwe

  #4  
Old July 19th, 2005, 05:20 PM
Mike Wahler
Guest
 
Posts: n/a
Default Re: creating a list of lists


Uwe Ziegenhagen <isestd14@wiwi.hu-berlin.de> wrote in message
news:bhbb7s$90i$1@lnews.rz.hu-berlin.de...[color=blue]
> Hi folks,
>
> one question:
>
> I try to create a list of lists, using
>
> std::list<std::list> testlist;[/color]

'std::list' requires a template argument.
The second one doesn't have one.
[color=blue]
>
> 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...[/color]

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

-Mike



 

Bookmarks

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles