[zeromq-dev] (no subject)

Pieter Hintjens ph at imatix.com
Fri Apr 22 08:05:28 CEST 2011


On Fri, Apr 22, 2011 at 7:27 AM, Martin Sustrik <sustrik at 250bpm.com> wrote:

> Ok. Another problem: Copy of a const message should be a const message.
> Imagine this prototype:
>
> int zmq_msg_const_copy (const zmq_msg_t *dest, const zmq_msg_t *src);
>
> The message passed as 'dest' is closed (non-const operation), then
> filled-in by the copy of the const message. Yet the parameter cannot be
> both const and non-const at the same time.

Isn't the problem here that you're mixing two methods in one, i.e.
'delete and then copy into'?

The side-effect of deleting any previous message is not nice,
especially since the rest of the message API is so pedantic.

If you made the copy semantics clean, the copy would be a const message.

I also like the idea of renaming 'close' to something more sensible,
delete (confusing IMO) or destroy (better).

-Pieter



More information about the zeromq-dev mailing list