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_view

Description

Metafunction that evaluates to mpl::true_ if a certain type T is a conforming Fusion View, mpl::false_ otherwise. A view is a specialized sequence that does not actually contain data. Views hold sequences which may be other views. In general, views are held by other views by value, while non-views are held by other views by reference. is_view may be specialized to accommodate clients providing Fusion conforming views.

Synopsis
namespace traits
{
    template <typename T>
    struct is_view
    {
        typedef unspecified type;
    };
}
Parameters

Parameter

Requirement

Description

T

Any type

The type to query.

Expression Semantics
typedef traits::is_view<T>::type c;

Return type: An MPL Boolean Constant.

Semantics: Metafunction that evaluates to mpl::true_ if a certain type T is a conforming Fusion view, mpl::false_ otherwise.

Header
#include <boost/fusion/support/is_view.hpp>
#include <boost/fusion/include/is_view.hpp>
Example
BOOST_MPL_ASSERT_NOT(( traits::is_view<std::vector<int> > ));
BOOST_MPL_ASSERT_NOT(( traits::is_view<int> ));

using boost::mpl::_
using boost::is_pointer;
typedef vector<int*, char, long*, bool, double> vector_type;
typedef filter_view<vector_type, is_pointer<_> > filter_view_type;
BOOST_MPL_ASSERT(( traits::is_view<filter_view_type> ));

PrevUpHomeNext