Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

is_async_read_stream

Determine if T meets the requirements of AsyncReadStream.

Synopsis

Defined in header <boost/beast/core/type_traits.hpp>

template<
    class T>
struct is_async_read_stream :
    public std::integral_constant< bool,...>
Description

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.

Example

Use with static_assert:

template<class AsyncReadStream>
void f(AsyncReadStream& stream)
{
    static_assert(is_async_read_stream<AsyncReadStream>::value,
        "AsyncReadStream requirements not met");
...

Use with std::enable_if (SFINAE):

template<class AsyncReadStream>
typename std::enable_if<is_async_read_stream<AsyncReadStream>::value>::type
f(AsyncReadStream& stream);

Convenience header <boost/beast/core.hpp>


PrevUpHomeNext