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

PrevUpHomeNext

is_sync_stream

Determine if T meets the requirements of SyncStream.

Synopsis

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

template<
    class T>
using is_sync_stream = see-below;
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 SyncStream>
void f(SyncStream& stream)
{
    static_assert (is_sync_stream<SyncStream>::value,
        "SyncStream type requirements not met" );
...

Use with std::enable_if (SFINAE):

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

PrevUpHomeNext