[zeromq-dev] c++ api issues

Burak Arslan burak.arslan at arskom.com.tr
Wed Oct 20 13:56:54 CEST 2010


 On 10/20/10 14:30, Martin Sustrik wrote:
> Burak,
>
>> 1) having the copy constructor private prevents zmq::message_t objects
>> from being part of a standard containers like std::list. is it possible
>> to change this, or should i resort to storing pointers to messages?
>>
>> i'm in favor of making the message_t copy ctor public. the documentation
>> makes it very clear that messages should not be re-used once sent.
>>
>>          //  Disable implicit message copying, so that users won't
>> use shared
>>          //  messages (less efficient) without being aware of the fact.
>>
>> you can prepend the ctor with explicit to prevent implicit calls to the
>> ctor.
>
> How would you implement the copy constructor?

hello martin,

is this a rhetorical question? from what i see, a regular deep-copying
copy ctor would do the job. but i'm not familiar enough with 0mq
internals to confidently answer it.

if that does not do the job, just documenting the reason would "fix" my
problem.

c++ users are expected to know about argument passing semantics. if the
sole reason is to protect the user (which is what the inline
documentation suggests), i think that restriction should be lifted as it
prevents some simple (yet less efficient) use cases.

as for other points, should i file issues? are they already done? in
which release are they going to be?

thanks,
burak





More information about the zeromq-dev mailing list