Ignoring the const
Learn when to ignore the const.
We'll cover the following...
When is const
ignored?
In the section about const functions, we saw that the following signatures are declared two different overloads.
We can overload a function based on its constness.
Press + to interact
#include <iostream>class A {public:void foo(){std:: cout<<"Non const"<< '\n';}void foo() const{std:: cout<<"const"<< '\n';}};int main() {A a;a.foo();}
On the ...