R
Rakesh Kumar
Hi -
I am actually trying to get my feet in multi-threaded C++
programming. While I am aware that the C++ standard does not talk
about threads (at least, for now - in C++03) - my question is more
about the language / usage rather than any thread specific question.
Sorry - if posted my mistake.
I understand that in C++ volatile objects ( those non-primitive type
instances qualified with 'volatile' ) can actually call only those
member functions qualified as volatile .
But there is also a construct - const_cast< T *> (p) , that can
convert a volatile object pointer to constant pointer that can be used
to invoke non-volatile methods on the class.
That being the case - what would be the significance of the
'volatile' keyword qualified for c++ member functions in particular -
if we are able to invoke the non-volatile functions by casting. Am I
missing a design picture here.
I am actually trying to get my feet in multi-threaded C++
programming. While I am aware that the C++ standard does not talk
about threads (at least, for now - in C++03) - my question is more
about the language / usage rather than any thread specific question.
Sorry - if posted my mistake.
I understand that in C++ volatile objects ( those non-primitive type
instances qualified with 'volatile' ) can actually call only those
member functions qualified as volatile .
But there is also a construct - const_cast< T *> (p) , that can
convert a volatile object pointer to constant pointer that can be used
to invoke non-volatile methods on the class.
That being the case - what would be the significance of the
'volatile' keyword qualified for c++ member functions in particular -
if we are able to invoke the non-volatile functions by casting. Am I
missing a design picture here.