Beast Logo

PrevUpHomeNext
websocket::stream::lowest_layer_type

The type of the lowest layer.

Synopsis
using lowest_layer_type = typename get_lowest_layer< next_layer_type >::type;

This will contain a nested type equal to T::lowest_layer_type if it exists, else type will be equal to T.

Example

Declaring a wrapper:

template<class Stream>
struct stream_wrapper
{
    using next_layer_type = typename std::remove_reference<Stream>::type;
    using lowest_layer_type = typename get_lowest_layer<stream_type>::type;
};

Defining a metafunction:

/// Alias for `std::true_type` if `T` wraps another stream
template<class T>
using is_stream_wrapper : std::integral_constant<bool,
    ! std::is_same<T, typename get_lowest_layer<T>::type>::value> {};
Description

PrevUpHomeNext