...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 T
meets the
requirements of AsyncStream.
Defined in header <boost/beast/core/stream_traits.hpp>
template< class T> using is_async_stream = see-below;
Metafunctions are used to perform compile time checking of template types.
This type will be std::true_type
if T
meets the requirements, else the type will be std::false_type
.
Use with static_assert
:
template<class AsyncStream> void f(AsyncStream& stream) { static_assert(is_async_stream<AsyncStream>::value, "AsyncStream type requirements not met"); ...
Use with std::enable_if
(SFINAE):
template<class AsyncStream> typename std::enable_if<is_async_stream<AsyncStream>::value>::type f(AsyncStream& stream);