summaryrefslogtreecommitdiff
path: root/boost/beast/core/detail/type_traits.hpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:24:45 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:24:45 +0900
commit5ce1cfc2525b06c0a9e38531813781de0281c96d (patch)
tree19cc66c6cf6396db288813b2558cc350f1deede2 /boost/beast/core/detail/type_traits.hpp
parent3c1df2168531ad5580076ae08d529054689aeedd (diff)
downloadboost-5ce1cfc2525b06c0a9e38531813781de0281c96d.tar.gz
boost-5ce1cfc2525b06c0a9e38531813781de0281c96d.tar.bz2
boost-5ce1cfc2525b06c0a9e38531813781de0281c96d.zip
Imported Upstream version 1.71.0upstream/1.71.0
Diffstat (limited to 'boost/beast/core/detail/type_traits.hpp')
-rw-r--r--boost/beast/core/detail/type_traits.hpp42
1 files changed, 13 insertions, 29 deletions
diff --git a/boost/beast/core/detail/type_traits.hpp b/boost/beast/core/detail/type_traits.hpp
index 3d895403b3..e94abbb179 100644
--- a/boost/beast/core/detail/type_traits.hpp
+++ b/boost/beast/core/detail/type_traits.hpp
@@ -10,36 +10,14 @@
#ifndef BOOST_BEAST_DETAIL_TYPE_TRAITS_HPP
#define BOOST_BEAST_DETAIL_TYPE_TRAITS_HPP
-#include <boost/beast/core/error.hpp>
-#include <boost/beast/core/detail/is_invocable.hpp>
-#include <boost/asio/buffer.hpp>
-#include <boost/mp11/function.hpp>
#include <boost/type_traits/make_void.hpp>
-#include <iterator>
-#include <tuple>
#include <type_traits>
-#include <string>
-#include <utility>
+#include <new>
namespace boost {
namespace beast {
namespace detail {
-// variadic min
-template<class T>
-T constexpr min(T t)
-{
- return t;
-}
-
-template<class T, class...Tn>
-T constexpr min(T t0, T t1, Tn... tn)
-{
- return (t0 < t1) ?
- (detail::min)(t0, tn...) :
- (detail::min)(t1, tn...);
-}
-
template<class U>
std::size_t constexpr
max_sizeof()
@@ -97,12 +75,6 @@ using aligned_union_t =
//------------------------------------------------------------------------------
-template<class T>
-void
-accept_rv(T){}
-
-//------------------------------------------------------------------------------
-
// for span
template<class T, class E, class = void>
struct is_contiguous_container: std::false_type {};
@@ -124,6 +96,18 @@ struct is_contiguous_container<T, E, void_t<
>::type>>: std::true_type
{};
+template <class T, class U>
+T launder_cast(U* u)
+{
+#if defined(__cpp_lib_launder) && __cpp_lib_launder >= 201606
+ return std::launder(reinterpret_cast<T>(u));
+#elif defined(BOOST_GCC) && BOOST_GCC_VERSION > 80000
+ return __builtin_launder(reinterpret_cast<T>(u));
+#else
+ return reinterpret_cast<T>(u);
+#endif
+}
+
} // detail
} // beast
} // boost