summaryrefslogtreecommitdiff
path: root/boost/endian/detail/is_trivially_copyable.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/endian/detail/is_trivially_copyable.hpp')
-rw-r--r--boost/endian/detail/is_trivially_copyable.hpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/boost/endian/detail/is_trivially_copyable.hpp b/boost/endian/detail/is_trivially_copyable.hpp
new file mode 100644
index 0000000000..334cd462c1
--- /dev/null
+++ b/boost/endian/detail/is_trivially_copyable.hpp
@@ -0,0 +1,39 @@
+#ifndef BOOST_ENDIAN_DETAIL_IS_TRIVIALLY_COPYABLE_HPP_INCLUDED
+#define BOOST_ENDIAN_DETAIL_IS_TRIVIALLY_COPYABLE_HPP_INCLUDED
+
+// Copyright 2019 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// http://www.boost.org/LICENSE_1_0.txt
+
+#include <boost/config.hpp>
+#include <boost/type_traits/has_trivial_copy.hpp>
+#include <boost/type_traits/has_trivial_assign.hpp>
+
+#if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
+# include <type_traits>
+#endif
+
+namespace boost
+{
+namespace endian
+{
+namespace detail
+{
+
+#if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
+
+using std::is_trivially_copyable;
+
+#else
+
+template<class T> struct is_trivially_copyable: boost::integral_constant<bool,
+ boost::has_trivial_copy<T>::value && boost::has_trivial_assign<T>::value> {};
+
+#endif
+
+} // namespace detail
+} // namespace endian
+} // namespace boost
+
+#endif // BOOST_ENDIAN_DETAIL_IS_TRIVIALLY_COPYABLE_HPP_INCLUDED