azmq icon indicating copy to clipboard operation
azmq copied to clipboard

Inconsistency of message's data constness

Open oliora opened this issue 10 years ago • 1 comments

Some azmq::message constructors accept const buffer and some accept mutable buffer (i.e. can not be used to construct from const buffer). The accessors of message are const except one (non-const buffer()).

I propose to change message to be constructed only from const buffer (remember that mutable buffer is convertible to const buffer) and to remove all non-const accessors, so message can not be used to modify the buffer it created from.

This change means that non-const buffer() should be removed. I never used this function in my code but I can assume that there are use cases when this function is needed. Let's discuss this use cases and find a way to satisfy them with new message design.

oliora avatar Sep 28 '15 21:09 oliora

@rodgert what do you think about this issue?

oliora avatar Oct 22 '15 08:10 oliora