12
What will be the output of the program?
#include <iostream>
using namespace std;
class P {
mutable int reads = 0;
int v = 5;
public:
int get() const { ++reads; return v; }
int count() const { return reads; }
};
int main() {
P p;
p.get(); p.get();
cout << p.count() << endl;
return 0;
}Hard