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

get_lowest_layer

Returns T::lowest_layer_type if it exists, else T

Synopsis

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

template<
    class T>
struct get_lowest_layer
Description

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:

template<class T>
using is_stream_wrapper : std::integral_constant<bool,
    ! std::is_same<T, typename get_lowest_layer<T>::type>::value> {};

Convenience header <boost/beast/core.hpp>


PrevUpHomeNext