I am trying the following code:
std::thread t(&(Transmitter::sender), this, some_variables);
where sender is a member function of the same class from whose method the above line is being called.
I get the warning:
Transmitter.h: In member function 'int Transmitter::transmit_streams(std::vector<std::vector<single_stream_record> >, int, Receiver&)':
Transmitter.h:81:44: error: ISO C++ forbids taking the address of an unqualified or parenthesized non-static member function to form a pointer to member function. Say '&Transmitter::sender' [-fpermissive]
though it compiles and runs fine. How can I remove this warning.
My g++ is 4.6.3 and I compile the code with -std=c++0x.