mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-05-05 08:45:30 +02:00
Problem: C++11 partially supported on gcc 4.8
Solution: Use intrinsic instead of std::is_trivially_copyable for gcc versions older than 5.
This commit is contained in:
parent
81c2938faa
commit
6137b485a0
@ -36,7 +36,7 @@ Supported platforms
|
|||||||
- Additional platforms that are known to work:
|
- Additional platforms that are known to work:
|
||||||
- We have no current reports on additional platforms that are known to work yet. Please add your platform here. If CI can be provided for them with a cloud-based CI service working with GitHub, you are invited to add CI, and make it possible to be included in the list above.
|
- We have no current reports on additional platforms that are known to work yet. Please add your platform here. If CI can be provided for them with a cloud-based CI service working with GitHub, you are invited to add CI, and make it possible to be included in the list above.
|
||||||
- Additional platforms that probably work:
|
- Additional platforms that probably work:
|
||||||
- Any platform supported by libzmq that provides a sufficiently recent gcc (4.8.1 or newer) or clang (3.3 or newer)
|
- Any platform supported by libzmq that provides a sufficiently recent gcc (4.8.1 or newer) or clang (3.4.1 or newer)
|
||||||
- Visual Studio 2012+ x86/x64
|
- Visual Studio 2012+ x86/x64
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
|
12
zmq.hpp
12
zmq.hpp
@ -122,6 +122,14 @@
|
|||||||
#define ZMQ_DELETED_FUNCTION
|
#define ZMQ_DELETED_FUNCTION
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ZMQ_CPP11
|
||||||
|
#if defined(__GNUC__) && __GNUC__ < 5
|
||||||
|
#define ZMQ_IS_TRIVIALLY_COPYABLE(T) __has_trivial_copy(T)
|
||||||
|
#else
|
||||||
|
#define ZMQ_IS_TRIVIALLY_COPYABLE(T) std::is_trivially_copyable<T>::value
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(3, 3, 0)
|
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(3, 3, 0)
|
||||||
#define ZMQ_NEW_MONITOR_EVENT_LAYOUT
|
#define ZMQ_NEW_MONITOR_EVENT_LAYOUT
|
||||||
#endif
|
#endif
|
||||||
@ -331,7 +339,7 @@ class message_t
|
|||||||
template<class Range,
|
template<class Range,
|
||||||
typename = typename std::enable_if<
|
typename = typename std::enable_if<
|
||||||
detail::is_range<Range>::value
|
detail::is_range<Range>::value
|
||||||
&& std::is_trivially_copyable<detail::range_value_t<Range>>::value
|
&& ZMQ_IS_TRIVIALLY_COPYABLE(detail::range_value_t<Range>)
|
||||||
&& !std::is_same<Range, message_t>::value>::type>
|
&& !std::is_same<Range, message_t>::value>::type>
|
||||||
explicit message_t(const Range &rng) :
|
explicit message_t(const Range &rng) :
|
||||||
message_t(detail::ranges::begin(rng), detail::ranges::end(rng))
|
message_t(detail::ranges::begin(rng), detail::ranges::end(rng))
|
||||||
@ -948,7 +956,7 @@ template<class T> struct is_pod_like
|
|||||||
// trivially copyable OR standard layout.
|
// trivially copyable OR standard layout.
|
||||||
// Here we decide to be conservative and require both.
|
// Here we decide to be conservative and require both.
|
||||||
static constexpr bool value =
|
static constexpr bool value =
|
||||||
std::is_trivially_copyable<T>::value && std::is_standard_layout<T>::value;
|
ZMQ_IS_TRIVIALLY_COPYABLE(T) && std::is_standard_layout<T>::value;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class C> constexpr auto seq_size(const C &c) noexcept -> decltype(c.size())
|
template<class C> constexpr auto seq_size(const C &c) noexcept -> decltype(c.size())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user