...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Determine if a type meets the Fields named requirements.
Defined in header <boost/beast/http/type_traits.hpp>
template< class T> using is_fields = see-below;
This alias template is std::true_type
if T
meets the requirements,
otherwise it is std::false_type
.
Type |
Description |
---|---|
|
The type to test. |
Use with static_assert
:
template<bool isRequest, class Body, class Fields> void f(message<isRequest, Body, Fields> const&) { static_assert(is_fields<Fields>::value, "Fields type requirements not met"); ...
Use with std::enable_if
(SFINAE):
template<bool isRequest, class Body, class Fields> typename std::enable_if<is_fields<Fields>::value>::type f(message<isRequest, Body, Fields> const&);