The error illegal in base/member initializer list occurs when declaring variables in the constructor. Or I do not understand how it works.

.cpp

 DroneConnection::DroneConnection( void ) :SLEEP_BETWEEN_POLLS_MS (1000) :TIMEOUT (5) { { m_port = 0; getDataFromXml(); m_wasDataRecieved.store( false ); m_continueRecieving.store( false ); } } 

.h

 ... private: const int SLEEP_BETWEEN_POLLS_MS; const int TIMEOUT; const int TIMEOUT_MS; ... 

The compiler also shows the expected {' to :TIMEOUT (5)

PS Do not throw slippers .. still in the study and the concept of language ...

    1 answer 1

    Here you need a comma instead of a colon. A colon separates the initialization list on behalf of the constructor. List items are separated by commas.

     DroneConnection::DroneConnection( void ) :SLEEP_BETWEEN_POLLS_MS (1000), TIMEOUT (5) {...}