<<<<<<< .working ======= >>>>>>> .merge-right.r57125
Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
<<<<<<< .working

is_view

Description

=======
Description
>>>>>>> .merge-right.r57125

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 accomodate clients providing Fusion conforming views.

<<<<<<< .working

Synopsis

=======
Synopsis
>>>>>>> .merge-right.r57125
namespace traits
{
    template <typename T>
    struct is_view
    {
        typedef unspecified type;
    };
}
<<<<<<< .working

Parameters

=======
Parameters
>>>>>>> .merge-right.r57125

Parameter

Requirement

Description

T

Any type

The type to query.

<<<<<<< .working

Expression Semantics

=======
Expression Semantics
>>>>>>> .merge-right.r57125
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.

<<<<<<< .working

Header

=======
Header
>>>>>>> .merge-right.r57125
#include <boost/fusion/support/is_view.hpp>
#include <boost/fusion/include/is_view.hpp>
<<<<<<< .working

Example

=======
Example
>>>>>>> .merge-right.r57125
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