Why can't a volatile object call a non-volatile member function

Why volatilecan't an object call a member function not volatile?

In the case, constit makes sense that calling a member function does not constviolate the constant of the object and, therefore, is prohibited. But why in the case volatile?

+5
source share
3 answers

In the case of const, it makes sense that calling a non-const member function violates the construction of the object and is therefore prohibited. But why in the case of volatiles?

volatile. , . , ( ). .

+4

:

7.1.5.1. , volatile-quailified, l , undefined.

, , undefined. , , .

+4

A qualifier volatileworks the same way it does const. To see what can be done through this, take a look at this Alexandrescu article . This article should also give you some insight into why.

+2
source

All Articles