[zeromq-dev] (no subject)
andrew S
nifigase at gmail.com
Wed Apr 20 17:00:00 CEST 2011
I suppose that const zmq_msg_t should mean both constant descriptor
(flags, VSM memory) and, as a consequence, constant BLOB (the memory
zmq_msg_t::content points to).
It would be good, if C API functions that do not modify neither
zmq_msg_t structure nor BLOB would take const zmq_msg_t * instead of
zmq_msg_t *.
for example: ZMQ_EXPORT size_t zmq_msg_size (const zmq_msg_t *msg);
On Wed, Apr 20, 2011 at 5:15 PM, Martin Sustrik <sustrik at 250bpm.com> wrote:
> Hi Ilja,
>
>> .. on the second thought it is not as straightforward and C API methods must be called with const_cast,
>> though I still think it is worth doing.
>
> Before changing the const signatures I would say we should make it clear
> what constant zmq_msg_t means.
>
> Keep in mind that zmq_msg_t is a BLOB descriptor rather than BLOB
> itself. In other words, several zmq_msg_t's can point to the same
> physical BLOB.
>
> So, does const zmq_msg_t mean that the descriptor is constant or rather
> that the BLOB itself is constant?
>
> Martin
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
More information about the zeromq-dev
mailing list