I'm trying to add values to a list inside a list after looping through the lists with iterators.
Here is an example of the structs used as the types for the lists.
1 2 3 4 5 6 7 8 9 10 11 12 13
struct type2
{
string sname;
int angle1;
int angle2;
};
struct type1
{
string name;
string sname;
list<type2> list2;
};
I think it is trying to use a non existant push_back function in one of the types. It is probably something simple, but I don't understand how to fix this.
EDIT: the first list is passed to the function by reference. this code is in that function.
Can you have a iterator inside a constant iterator, or do both iterators need to not be constant?
EDIT: Nevermind I found the answer. You can have const_iterator inside a iterator, but you can't have iterator inside a const_iterator.