Insert an element to std::set using constructor

Posted by Dave17 on Stack Overflow See other posts from Stack Overflow or by Dave17
Published on 2010-03-08T21:12:29Z Indexed on 2010/03/08 21:36 UTC
Read the original article Hit count: 177

Filed under:
|

is it possible to insert a new element to std::set like in case of std::list for example:

//insert one element named "string" to sublist of mylist

std::list< std::list<string> > mylist;
mylist.push_back(std::list<string>(1, "string"));

Now, mylist has one element of type std::string in its sub-list of type std::list.

How can you do the same in if std::set is the sub-set of std::list my list i.e

std::list<std::set <string>> mylist;

if you can't then why not?

© Stack Overflow or respective owner

Related posts about c++

Related posts about stl