Skip to content

Commit

Permalink
Replace checks for C++17 with string view macro
Browse files Browse the repository at this point in the history
  • Loading branch information
gummif committed May 16, 2020
1 parent a2ef92e commit 6d71b9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ TEST_CASE("socket options", "[socket]")
socket.set(zmq::sockopt::routing_id, "foobar");
socket.set(zmq::sockopt::routing_id, zmq::buffer(id));
socket.set(zmq::sockopt::routing_id, id);
#ifdef ZMQ_CPP17
#if defined(ZMQ_HAS_STRING_VIEW) && (ZMQ_HAS_STRING_VIEW > 0)
socket.set(zmq::sockopt::routing_id, std::string_view{id});
#endif

Expand Down
4 changes: 2 additions & 2 deletions zmq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ class message_t
{
return std::string(static_cast<const char *>(data()), size());
}
#ifdef ZMQ_CPP17
#if defined(ZMQ_HAS_STRING_VIEW) && (ZMQ_HAS_STRING_VIEW > 0)
// interpret message content as a string
std::string_view to_string_view() const noexcept
{
Expand Down Expand Up @@ -1662,7 +1662,7 @@ class socket_base
set_option(Opt, buf.data(), buf.size());
}

#ifdef ZMQ_CPP17
#if defined(ZMQ_HAS_STRING_VIEW) && (ZMQ_HAS_STRING_VIEW > 0)
// Set array socket option, e.g.
// `socket.set(zmq::sockopt::routing_id, id_str)`
template<int Opt, int NullTerm>
Expand Down

0 comments on commit 6d71b9b

Please sign in to comment.