What does the const in this function mean in UML?

length() const : int

I get that int is the return type here but what is the keyword const after the function? What does it even mean?
My guess is that it means length() does not mutate the object *this.
In other words, you can call foo.length() when foo is const. This is consistent with the C++ notation for a const-qualified method.

In UML speak, perhaps this has something to do with the isQuery attribute, which specifies an operation
• causes no changes or side-effects to the system.

https://users.csc.calpoly.edu/~djanzen/courses/402F09/presentations/UML.pdf

N.B., this is conjecture - I don't have any use for UML.
closed account (48T7M4Gy)
http://stackoverflow.com/questions/3926929/const-function-specification-in-uml
Topic archived. No new replies allowed.