
Declaring a Volatile Member Function
You’re probably familiar with const member functions such as: class A { public: int get_x() const; // can’t change A’s state }; C++ also supports volatile member functions. You declare a member function with the volatile specifier to ensure that it can be called safely for a volatile object: class