J
john smith
Hi, I have a question about map and classes that contain maps. My problem
is declaring any class methods const that would do something to the map.
Presumably it's because when operator[] is accessed, the map object can be
changed. Is there any way that I can somehow say that I'm not going to
change the map object?
Also, it becomes a problem when I try to declare the copy constructor like
this:
class A {
A(const A& x); // this has a problem, and has to be A(A& x)
};
any help on this would be appreciated. Thanks.
S.
is declaring any class methods const that would do something to the map.
Presumably it's because when operator[] is accessed, the map object can be
changed. Is there any way that I can somehow say that I'm not going to
change the map object?
Also, it becomes a problem when I try to declare the copy constructor like
this:
class A {
A(const A& x); // this has a problem, and has to be A(A& x)
};
any help on this would be appreciated. Thanks.
S.