zeromq / zmqpp

0mq 'highlevel' C++ bindings
http://zeromq.github.io/zmqpp
Mozilla Public License 2.0
439 stars 195 forks source link

Add overload for socket::set(socket_option const&, const char *) #13

Closed ahmedtd closed 11 years ago

ahmedtd commented 11 years ago

When setting a socket option like:

mysocket.set(socket_option::subscribe, "myprefix");

the C++ standard requires that the bool override for set be considered before the std::string override. This causes the above code to fail by throwing an exception that complains that a bool option is being set with a non-bool value.

An explicit override for const char * will capture the literal properly.

benjamg commented 11 years ago

Thanks, clearly I never had tests for setting these options directly (always going via the helper functions).

ahmedtd commented 11 years ago

Wow, thanks for the quick response. I'm loving the bindings, by the way.

benjamg commented 11 years ago

Your welcome. If you spot any other bugs, or have suggestions feel free to raise issues (or code patches)