creating a list of lists

U

Uwe Ziegenhagen

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
 
U

Uwe Ziegenhagen

Uwe said:
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
 
V

Victor Bazarov

Uwe Ziegenhagen said:
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
 
M

Mike Wahler

Uwe Ziegenhagen said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top