I have a nested set of ints but I cannot insert elements into the nested sets.
std::set<std::set<int> > centre_as_set = bitset_to_set(centre->second->bit_partitions);
std::set<std::set<int> >::iterator set_itr;
for ( set_itr = centre_as_set.begin(); set_itr != centre_as_set.end(); ++set_itr ) {
set_itr->insert(4);
std::set<int>::iterator node_itr;
for ( node_itr = set_itr->begin(); node_itr != set_itr->end(); ++node_itr ) {
std::cout << *node_itr;
}
}
}
The error is
Partition_standalone.cpp:612: error: passing ‘const std::set, std::allocator >’ as ‘this’ argument of ‘std::pair, _Compare, typename _Alloc::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(const _Key&) [with _Key = int, _Compare = std::less, _Alloc = std::allocator]’ discards qualifiers
I can't quite decipher that template error, any help appreciated.