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

PrevUpHomeNext

deref

Description

Returns the type that will be returned by dereferencing an iterator.

Synopsis
template<
    typename I
    >
struct deref
{
    typedef unspecified type;
};

Table 1.12. Parameters

Parameter

Requirement

Description

I

Model of Forward Iterator

Operation's argument


Expression Semantics
result_of::deref<I>::type

Return type: Any type

Semantics: Returns the result of dereferencing an iterator of type I.

Header
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/include/deref.hpp>
Example
typedef vector<int,int&> vec;
typedef const vec const_vec;
typedef result_of::begin<vec>::type first;
typedef result_of::next<first>::type second;

typedef result_of::begin<const_vec>::type const_first;
typedef result_of::next<const_first>::type const_second;

BOOST_MPL_ASSERT((boost::is_same<result_of::deref<first>::type, int&>));
BOOST_MPL_ASSERT((boost::is_same<result_of::deref<second>::type, int&>));

PrevUpHomeNext