ゴミ箱
type_traits.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
3 //
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)
6 //
7 // Official repository: https://github.com/boostorg/beast
8 //
9 
10 #ifndef BOOST_BEAST_HTTP_TYPE_TRAITS_HPP
11 #define BOOST_BEAST_HTTP_TYPE_TRAITS_HPP
12 
13 #include <boost/beast/config.hpp>
18 #include <boost/asio/buffer.hpp>
19 #include <boost/optional.hpp>
20 #include <type_traits>
21 #include <utility>
22 
23 namespace boost {
24 namespace beast {
25 namespace http {
26 
27 template<bool, class, class>
28 struct message;
29 
47 template<class T>
48 #if BOOST_BEAST_DOXYGEN
49 struct is_body : std::integral_constant<bool, ...>{};
50 #else
52 #endif
53 
74 #if BOOST_BEAST_DOXYGEN
75 template<class T>
76 struct is_body_reader : std::integral_constant<bool, ...> {};
77 #else
78 template<class T, class = void>
79 struct is_body_reader : std::false_type {};
80 
81 template<class T>
82 struct is_body_reader<T, beast::detail::void_t<
83  typename T::reader,
84  typename T::reader::const_buffers_type,
85  decltype(
86  std::declval<typename T::reader&>().init(std::declval<error_code&>()),
87  std::declval<boost::optional<std::pair<
88  typename T::reader::const_buffers_type, bool>>&>() =
89  std::declval<typename T::reader>().get(std::declval<error_code&>()),
90  (void)0)>> : std::integral_constant<bool,
91  is_const_buffer_sequence<
92  typename T::reader::const_buffers_type>::value &&
93  std::is_constructible<typename T::reader,
94  message<true, T, detail::fields_model>&>::value &&
95  std::is_constructible<typename T::reader,
96  message<false, T, detail::fields_model>&>::value
97  > {};
98 #endif
99 
120 #if BOOST_BEAST_DOXYGEN
121 template<class T>
122 struct is_body_writer : std::integral_constant<bool, ...> {};
123 #else
124 template<class T, class = void>
125 struct is_body_writer : std::false_type {};
126 
127 template<class T>
128 struct is_body_writer<T, beast::detail::void_t<decltype(
129  std::declval<typename T::writer&>().init(
130  boost::optional<std::uint64_t>(),
131  std::declval<error_code&>()),
132  std::declval<std::size_t&>() =
133  std::declval<typename T::writer&>().put(
134  std::declval<boost::asio::const_buffers_1>(),
135  std::declval<error_code&>()),
136  std::declval<typename T::writer&>().finish(
137  std::declval<error_code&>()),
138  (void)0)>> : std::integral_constant<bool,
139  std::is_constructible<typename T::writer,
140  message<true, T, detail::fields_model>&>::value &&
141  std::is_constructible<typename T::writer,
142  message<false, T, detail::fields_model>&>::value
143  >
144 {
145 };
146 #endif
147 
173 #if BOOST_BEAST_DOXYGEN
174 template<class T>
175 struct is_fields : std::integral_constant<bool, ...> {};
176 #else
177 template<class T>
179 #endif
180 
181 } // http
182 } // beast
183 } // boost
184 
185 #endif
Definition: async_result.hpp:20
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:125
Definition: type_traits.hpp:79
detail::has_value_type< T > is_body
Definition: type_traits.hpp:51
typename make_void< Ts... >::type void_t
Definition: type_traits.hpp:62
Definition: type_traits.hpp:73
typename detail::is_fields_helper< T >::type is_fields
Definition: type_traits.hpp:178