Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: sock.get(zmq::sockopt::type) is not typesafe #523

Merged
merged 1 commit into from
Oct 22, 2021

Commits on Oct 21, 2021

  1. Problem: sock.get(zmq::sockopt::type) is not typesafe

    Solution: Add `zmq::sockopt::socket_type` that is used to `get()` an enumerator
    from `zmq::socket_type` instead of plain `int`.
    
    It makes code like this compile:
    
      #include <zmq.hpp>
    
      #include <cassert>
    
      int main()
      {
          zmq::context_t ctx;
          zmq::socket_t sock(ctx, zmq::socket_type::push);
          assert(sock.get(zmq::sockopt::socket_type) == zmq::socket_type::push);
          return 0;
      }
    jasujm committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    cbe4499 View commit details
    Browse the repository at this point in the history