correct use of const qualifier

Issue #12 resolved
WorkerH created an issue

There are some parts of the code where a const qualifier is missing. E.g.:

std::ostream & operator<<(std::ostream & os, Message & message)

Should be:

std::ostream & operator<<(std::ostream & os, const Message & message)

Due to this leads to errors if the caller trys to print a const Message&. E.g.:

void SomeClass::print_message() const
{
    std::cout << message_ << std::endl; // Error here, even thought this should be correct
}

Comments (5)

  1. Log in to comment