[zeromq-dev] Question about constness

Ming Ji finalguy at gmail.com
Wed Jul 25 03:26:56 CEST 2012


Hi Sebastian,

Thanks for pointing out the previous threads about this issue. I went 
through all three of them. I saw someone mentioned const_cast. I would 
say that is a good way for people who knows the implementation details. 
For general users, it is still not safe. For example, zmq_msg_copy will 
destroy the original message. It is probably not a good idea to cast the 
const message and pass it to this function. We don't know if other 
functions will change the original messages, so it is in general not a 
good idea to blindly do the const_cast.

Could you share your interface, or C++ API patch? I can probably do a 
test run before you release it.

Thanks



More information about the zeromq-dev mailing list