Can the volatile be used for class objects? Like:
volatile Myclass className;
The problem is that it doesn't compile, everywhere when some method is invoked, the error says: error C2662: 'function' : cannot convert 'this' pointer from 'volatile MyClass' to 'MyCLass &'
What is the problem here and how to solve it?
EDIT:
class Queue {
private:
struct Data *data;
int amount;
int size;
public:
Queue ();
~Queue ();
bool volatile push(struct Data element);
bool volatile pop(struct Data *element);
void volatile cleanUp();
};
.....
volatile Queue dataIn;
.....
EnterCriticalSection(&CriticalSection);
dataIn.push(element);
LeaveCriticalSection(&CriticalSection);