...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Returns the type stored at the position of an iterator.
template< typename I > struct value_of { typedef unspecified type; };
Table 1.11. Parameters
Parameter |
Requirement |
Description |
---|---|---|
I |
Model of Forward Iterator |
Operation's argument |
result_of::value_of<I>::type
Return type: Any type
Semantics: Returns the type stored in a sequence at iterator position I.
#include <boost/fusion/iterator/value_of.hpp> #include <boost/fusion/include/value_of.hpp>
typedef vector<int,int&,const int&> vec; typedef result_of::begin<vec>::type first; typedef result_of::next<first>::type second; typedef result_of::next<second>::type third; BOOST_MPL_ASSERT((boost::is_same<result_of::value_of<first>::type, int>)); BOOST_MPL_ASSERT((boost::is_same<result_of::value_of<second>::type, int&>)); BOOST_MPL_ASSERT((boost::is_same<result_of::value_of<third>::type, const int&>));