2 // Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 #ifndef BEAST_DETAIL_TYPE_TRAITS_HPP
9 #define BEAST_DETAIL_TYPE_TRAITS_HPP
12 #include <type_traits>
26 using void_t = typename make_void<Ts...>::type;
31 ignore_unused(Ts const& ...)
48 template<class U0, class U1, class... Us>
53 max_sizeof<U0>() > max_sizeof<U1, Us...>() ?
54 max_sizeof<U0>() : max_sizeof<U1, Us...>();
57 template<unsigned N, class T, class... Tn>
58 struct repeat_tuple_impl
60 using type = typename repeat_tuple_impl<
61 N - 1, T, T, Tn...>::type;
64 template<class T, class... Tn>
65 struct repeat_tuple_impl<0, T, Tn...>
67 using type = std::tuple<T, Tn...>;
70 template<unsigned N, class T>
74 typename repeat_tuple_impl<N-1, T>::type;
78 struct repeat_tuple<0, T>
80 using type = std::tuple<>;
83 template<class Exception>
85 make_exception(char const* reason, char const* file, int line)
88 for(auto p = file; *p; ++p)
89 if(*p == '\\' || *p == '/')
91 return Exception{std::string(reason) + " (" +
92 n + ":" + std::to_string(line) + ")"};