Original Post
Hello, I have my problems with standard set. I have a set with a class as parameter over wich I want to iterate like this: On the line marked with "Offending line" I get the following compile error: "passing const A as 'this' argument of 'void A::func()' discards qualifiers" The problem is solved if I declare "func" as const: But I want to make changes to A from within "func" :( What can I do? thanks! Nathan
class A
{
void func();
};
int main()
{
std::set set;
...
std::set::iterator i;
for(i=set.begin();i!=set.end();++i)
{
(*i).func(); //Offending line
}
...
}
class A
{
void func() const;
}
...