Possible Duplicate:
C++ STL set update is tedious: I can’t change an element in place
I am stumped:
struct File {
struct Handle {
size_t count;
};
std::set<Handle>::iterator handle_;
~File() {
File::close(*this);
}
static void close(File &f) {
(*f.handle_).count--;
}
};
With ICC the error is:
error #137: expression must be a modifiable lvalue
(*f.handle_).count++;
^
Why is std::set::iterator const?