"const" outside of function parameters.

What does the function declaration below mean?

 
  string blahBlah() const;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class foo{
//...
   string bar() const; //promise to not modify the calling object
   string zoo();
};

void asdf(const foo &obj){
   obj.bar(); //fine
   obj.zoo(); //error: 
}

int main(){
   foo obj;
   obj.bar(); //the state of the object remains the same
}
where can one find documentation on this ? What would the search subject be?
Try searching on here for "const correctness" or on google for "C++ const correctness".
Topic archived. No new replies allowed.