struct Group
{
Group(string _N, set <string> M_)
{Name = N_; Member = M_}
string Name;
set <string> Members;
};
int main()
{
list <Group> GroupList;
set <string> Members;
//collect the members from a file and add to set
GroupList.pushback(Group(Name, Members));
}
is there a less memory consuming way to the add the members to group instead of passing the whole set to the constructor?
Edit: Renamed the variables starting with underscore.
You can pass a reference and then make a copy and use initialisation list, same with the string.