...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
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.
namespace traits { template <typename T> struct is_view { typedef unspecified type; }; }
Parameter |
Requirement |
Description |
---|---|---|
|
Any type |
The type to query. |
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.
#include <boost/fusion/support/is_view.hpp> #include <boost/fusion/include/is_view.hpp>
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; typedefvector
<int*, char, long*, bool, double> vector_type; typedeffilter_view
<vector_type, is_pointer<_> > filter_view_type; BOOST_MPL_ASSERT(( traits::is_view<filter_view_type> ));