It is said that a function is const if it doesn't modify the object. So, does it mean that only functions operating on objects can be const functions? In other words, member functions, friend functions can be constant. For non-member functions, if they are passed by reference-to-const, it will always be const. Are these statements correct? Thanks in advance.
Asked
Active
Viewed 42 times
0
-
just found [this on google](http://duramecho.com/ComputerInformation/WhyHowCppConst.html) – Thomas Ayoub May 07 '15 at 14:39
-
In a non-member function, what should `const`? I mean in a free function you can of course have const parameters and const return values, but what else should be const? – 463035818_is_not_an_ai May 07 '15 at 14:46
-
" if they are passed by reference-to-const" do you mean the parameters of the function, or the function itself that is passed to something? – 463035818_is_not_an_ai May 07 '15 at 14:47