@@ -328,8 +328,8 @@ inline int poll(std::vector<zmq_pollitem_t> &items, long timeout_ = -1)
328328}
329329
330330template <std::size_t SIZE>
331- inline int poll (std::array<zmq_pollitem_t , SIZE>& items,
332- std::chrono::milliseconds timeout)
331+ inline int poll (std::array<zmq_pollitem_t , SIZE> & items,
332+ std::chrono::milliseconds timeout)
333333{
334334 return poll (items.data (), items.size (), static_cast <long >(timeout.count ()));
335335}
@@ -350,13 +350,14 @@ inline std::tuple<int, int, int> version()
350350}
351351
352352#if !defined(ZMQ_CPP11_PARTIAL)
353- namespace detail {
353+ namespace detail
354+ {
354355template <class T > struct is_char_type
355356{
356357 // true if character type for string literals in C++11
357358 static constexpr bool value =
358- std::is_same<T, char >::value || std::is_same<T, wchar_t >::value ||
359- std::is_same<T, char16_t >::value || std::is_same<T, char32_t >::value;
359+ std::is_same<T, char >::value || std::is_same<T, wchar_t >::value
360+ || std::is_same<T, char16_t >::value || std::is_same<T, char32_t >::value;
360361};
361362}
362363#endif
@@ -397,8 +398,7 @@ class message_t
397398 int rc = zmq_msg_init_size (&msg, size_);
398399 if (rc != 0 )
399400 throw error_t ();
400- if (size_)
401- {
401+ if (size_) {
402402 // this constructor allows (nullptr, 0),
403403 // memcpy with a null pointer is UB
404404 memcpy (data (), data_, size_);
@@ -418,13 +418,12 @@ class message_t
418418 // when called with a string literal.
419419 // An overload taking const char* can not be added because
420420 // it would be preferred over this function and break compatiblity.
421- template <class Char , size_t N,
422- typename = typename std::enable_if<
423- detail::is_char_type<Char>::value
424- >::type
425- >
426- ZMQ_DEPRECATED (
427- " from 4.7.0, use constructors taking iterators, (pointer, size) or strings instead" )
421+ template <
422+ class Char ,
423+ size_t N,
424+ typename = typename std::enable_if<detail::is_char_type<Char>::value>::type>
425+ ZMQ_DEPRECATED (" from 4.7.0, use constructors taking iterators, (pointer, size) "
426+ " or strings instead" )
428427 explicit message_t(const Char (&data)[N]) :
429428 message_t(detail::ranges::begin(data), detail::ranges::end(data))
430429 {
@@ -441,16 +440,10 @@ class message_t
441440 {
442441 }
443442
444- explicit message_t (const std::string &str) :
445- message_t(str.data(), str.size())
446- {
447- }
443+ explicit message_t (const std::string &str) : message_t(str.data(), str.size()) {}
448444
449445#if CPPZMQ_HAS_STRING_VIEW
450- explicit message_t (std::string_view str) :
451- message_t(str.data(), str.size())
452- {
453- }
446+ explicit message_t (std::string_view str) : message_t(str.data(), str.size()) {}
454447#endif
455448
456449#endif
@@ -1367,19 +1360,19 @@ template<int Opt, int NullTerm = 1> struct array_option
13671360
13681361#define ZMQ_DEFINE_INTEGRAL_OPT (OPT, NAME, TYPE ) \
13691362 using NAME##_t = integral_option<OPT, TYPE, false >; \
1370- ZMQ_INLINE_VAR ZMQ_CONSTEXPR_VAR NAME##_t NAME{}
1363+ ZMQ_INLINE_VAR ZMQ_CONSTEXPR_VAR NAME##_t NAME {}
13711364#define ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT (OPT, NAME, TYPE ) \
13721365 using NAME##_t = integral_option<OPT, TYPE, true >; \
1373- ZMQ_INLINE_VAR ZMQ_CONSTEXPR_VAR NAME##_t NAME{}
1366+ ZMQ_INLINE_VAR ZMQ_CONSTEXPR_VAR NAME##_t NAME {}
13741367#define ZMQ_DEFINE_ARRAY_OPT (OPT, NAME ) \
13751368 using NAME##_t = array_option<OPT>; \
1376- ZMQ_INLINE_VAR ZMQ_CONSTEXPR_VAR NAME##_t NAME{}
1369+ ZMQ_INLINE_VAR ZMQ_CONSTEXPR_VAR NAME##_t NAME {}
13771370#define ZMQ_DEFINE_ARRAY_OPT_BINARY (OPT, NAME ) \
13781371 using NAME##_t = array_option<OPT, 0 >; \
1379- ZMQ_INLINE_VAR ZMQ_CONSTEXPR_VAR NAME##_t NAME{}
1372+ ZMQ_INLINE_VAR ZMQ_CONSTEXPR_VAR NAME##_t NAME {}
13801373#define ZMQ_DEFINE_ARRAY_OPT_BIN_OR_Z85 (OPT, NAME ) \
13811374 using NAME##_t = array_option<OPT, 2 >; \
1382- ZMQ_INLINE_VAR ZMQ_CONSTEXPR_VAR NAME##_t NAME{}
1375+ ZMQ_INLINE_VAR ZMQ_CONSTEXPR_VAR NAME##_t NAME {}
13831376
13841377// duplicate definition from libzmq 4.3.3
13851378#if defined _WIN32
@@ -2191,7 +2184,6 @@ class socket_t : public detail::socket_base
21912184 throw error_t ();
21922185 if (ctxptr == ZMQ_NULLPTR)
21932186 throw error_t ();
2194-
21952187 }
21962188};
21972189
0 commit comments