std::set does not have a constructor that accepts an inserted element. The best you can do is use a range constructor:
int a[] = {1,2,3,4,5}; std::set<int> foo(a, a+5);
This version accepts the begin and end iterator, which describes the range to be inserted into the set. You can also specify sorting criteria. This is not quite what you wanted, but it is close. Therefore, if you have your items stored in container v , you can insert a new set into your list as follows:
list<set<string> > myList; myList.push_back(set<string>(v.begin(), v.end()));
source share