I’m all for making code require less and less documentation.
the current form of this function is this:
void MessageListener::postMessage ( Message * message ) const
it’s not obvious without reading the documentation that the MessageListener will take ownership of the passed-in message.
Since the framework isn’t using ScopedPointers and is using std::unique_ptr’s instead, I think the MessageListener class would benefit from this bit of self-documenting code, which shows that the MessageListener is taking ownership of the message you’re passing to it.
void MessageListener::postMessage( std::unique<ptr<Message> message ) const;
the only way to post a message would be to
std::unique_ptr<Message> myMessage = std::make_unique<Message>();
messageListener.postMessage( std::move( myMessage ) );
any comments?