10 #ifndef BOOST_BEAST_HTTP_DETAIL_TYPE_TRAITS_HPP 11 #define BOOST_BEAST_HTTP_DETAIL_TYPE_TRAITS_HPP 14 #include <boost/optional.hpp> 21 template<
bool isRequest,
class Fields>
24 template<
bool,
class,
class>
27 template<
bool isRequest,
class Body,
class Fields>
35 template<
bool b,
class F>
36 static std::true_type check(
38 static std::false_type check(...);
40 using type = decltype(check((T*)0));
49 template<
bool isRequest,
class Body,
class Fields>
62 bool get_chunked_impl()
const;
63 bool get_keep_alive_impl(
unsigned)
const;
67 void set_chunked_impl(
bool);
68 void set_content_length_impl(boost::optional<std::uint64_t>);
69 void set_keep_alive_impl(
unsigned,
bool);
72 template<
class T,
class = beast::detail::
void_t<>>
77 typename T::value_type
78 > > : std::true_type {};
85 template<
class T,
class =
void>
90 typename T::value_type,
92 std::declval<std::uint64_t&>() =
93 T::size(std::declval<typename T::value_type const&>()),
94 (void)0)>> : std::true_type {};
99 template<
class U = is_fields_helper>
100 static auto f1(
int) -> decltype(
101 std::declval<string_view&>() = std::declval<U const&>().get_method_impl(),
103 static auto f1(...) -> std::false_type;
104 using t1 = decltype(f1(0));
106 template<
class U = is_fields_helper>
107 static auto f2(
int) -> decltype(
108 std::declval<string_view&>() = std::declval<U const&>().get_target_impl(),
110 static auto f2(...) -> std::false_type;
111 using t2 = decltype(f2(0));
113 template<
class U = is_fields_helper>
114 static auto f3(
int) -> decltype(
115 std::declval<string_view&>() = std::declval<U const&>().get_reason_impl(),
117 static auto f3(...) -> std::false_type;
118 using t3 = decltype(f3(0));
120 template<
class U = is_fields_helper>
121 static auto f4(
int) -> decltype(
122 std::declval<bool&>() = std::declval<U const&>().get_chunked_impl(),
124 static auto f4(...) -> std::false_type;
125 using t4 = decltype(f4(0));
127 template<
class U = is_fields_helper>
128 static auto f5(
int) -> decltype(
129 std::declval<bool&>() = std::declval<U const&>().get_keep_alive_impl(
130 std::declval<unsigned>()),
132 static auto f5(...) -> std::false_type;
133 using t5 = decltype(f5(0));
135 template<
class U = is_fields_helper>
136 static auto f6(
int) -> decltype(
137 void(std::declval<U&>().set_method_impl(std::declval<string_view>())),
139 static auto f6(...) -> std::false_type;
140 using t6 = decltype(f6(0));
142 template<
class U = is_fields_helper>
143 static auto f7(
int) -> decltype(
144 void(std::declval<U&>().set_target_impl(std::declval<string_view>())),
146 static auto f7(...) -> std::false_type;
147 using t7 = decltype(f7(0));
149 template<
class U = is_fields_helper>
150 static auto f8(
int) -> decltype(
151 void(std::declval<U&>().set_reason_impl(std::declval<string_view>())),
153 static auto f8(...) -> std::false_type;
154 using t8 = decltype(f8(0));
156 template<
class U = is_fields_helper>
157 static auto f9(
int) -> decltype(
158 void(std::declval<U&>().set_chunked_impl(std::declval<bool>())),
160 static auto f9(...) -> std::false_type;
161 using t9 = decltype(f9(0));
163 template<
class U = is_fields_helper>
164 static auto f10(
int) -> decltype(
165 void(std::declval<U&>().set_content_length_impl(
166 std::declval<boost::optional<std::uint64_t>>())),
168 static auto f10(...) -> std::false_type;
169 using t10 = decltype(f10(0));
171 template<
class U = is_fields_helper>
172 static auto f11(
int) -> decltype(
173 void(std::declval<U&>().set_keep_alive_impl(
174 std::declval<unsigned>(),
175 std::declval<bool>())),
177 static auto f11(...) -> std::false_type;
178 using t11 = decltype(f11(0));
180 using type = std::integral_constant<bool,
181 t1::value && t2::value && t3::value &&
182 t4::value && t5::value && t6::value &&
183 t7::value && t8::value && t9::value &&
184 t10::value && t11::value>;
Definition: async_result.hpp:20
Definition: type_traits.hpp:86
Definition: type_traits.hpp:25
decltype(f5(0)) t5
Definition: type_traits.hpp:133
decltype(f10(0)) t10
Definition: type_traits.hpp:169
Definition: beast_common.hpp:6
std::integral_constant< bool, t1::value &&t2::value &&t3::value &&t4::value &&t5::value &&t6::value &&t7::value &&t8::value &&t9::value &&t10::value &&t11::value > type
Definition: type_traits.hpp:184
Definition: type_traits.hpp:47
decltype(f9(0)) t9
Definition: type_traits.hpp:161
decltype(f11(0)) t11
Definition: type_traits.hpp:178
typename is_header_impl< T >::type is_header
Definition: type_traits.hpp:44
typename make_void< Ts... >::type void_t
Definition: type_traits.hpp:62
Definition: type_traits.hpp:97
Definition: type_traits.hpp:28
decltype(f3(0)) t3
Definition: type_traits.hpp:118
Definition: type_traits.hpp:73
boost::string_ref string_view
The type of string view used by the library.
Definition: string.hpp:36
decltype(f2(0)) t2
Definition: type_traits.hpp:111
decltype(f7(0)) t7
Definition: type_traits.hpp:147
decltype(f6(0)) t6
Definition: type_traits.hpp:140
decltype(f4(0)) t4
Definition: type_traits.hpp:125
Definition: type_traits.hpp:52
decltype(f8(0)) t8
Definition: type_traits.hpp:154
decltype(f1(0)) t1
Definition: type_traits.hpp:104