Feb 28, 2022 at 5:00pm
For that case, the const goes after the () and the function has to be a class member function. In the above, the const is before the () !
@Ivanka - is this a misprint as that is invalid syntax?
Feb 28, 2022 at 5:19pm
It is a promise that the function will not modify the object that it's called on.
|
obj.readData(); // will not modify obj
|
It's similar to marking reference parameters as const.
|
foo(obj); // will not modify obj
|
Last edited on Feb 28, 2022 at 5:22pm