[zeromq-dev] const

Ilja Golshtein ilejncs at narod.ru
Wed Apr 20 15:31:41 CEST 2011


Martin,

std::string may be called a descriptor as well, though this fact is not really important, is it?
It is just an implementation detail.

In my humble opinion the answer is "message as a logical object is not changed". It is possible to modify
some internals like reference counters in constant methods.

What I've forgotten, C API does not use const, so const_cast is required.

Thanks.

20.04.2011, 17:15, "Martin Sustrik" <sustrik at 250bpm.com>:
> 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

-- 
Best regards,
Ilja Golshtein.



More information about the zeromq-dev mailing list