...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.12. Parameters
Parameter |
Requirement |
Description |
---|---|---|
|
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>
typedefvector
<int,int&,const int&> vec; typedefresult_of::begin
<vec>::type first; typedefresult_of::next
<first>::type second; typedefresult_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&>));