By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,234 Members | 1,889 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,234 IT Pros & Developers. It's quick & easy.

creating a list of lists

P: n/a
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

Jul 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Uwe Ziegenhagen" <is******@wiwi.hu-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
Jul 19 '05 #2

P: n/a
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

Jul 19 '05 #3

P: n/a

Uwe Ziegenhagen <is******@wiwi.hu-berlin.de> wrote in message
news:bh**********@lnews.rz.hu-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

Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.