Hi,
I've been trying this for awhile and I'm just about to give up and use volatile char* instead. I cannot even get this to work with a simple example. What am I missing?
Here's the most simple example I can think of that illustrates my problem:
Here's the compiler error, compiled with g++:Code:#include <string> using namespace std; volatile string blah; int main(int argc, char** argv) { blah = ""; }
I can't even make sense of that error. string.assign() gives a similar error.Code:main.cpp: In function ‘int main(int, char**)’: main.cpp:7: error: passing ‘volatile std::string’ as ‘this’ argument of ‘std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’ discards qualifiers




Reply With Quote