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

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext
at
Description

Returns the result type of at [5] .

Synopsis
template<
    typename Seq,
    typename N>
struct at
{
    typedef unspecified type;
};

Table 1.25. Parameters

Parameter

Requirement

Description

Seq

A model of Forward Sequence

Argument sequence

N

An MPL Integral Constant

Index of element


Expression Semantics
result_of::at<Seq, N>::type

Return type: Any type.

Semantics: Returns the result type of using at to access the Nth element of Seq.

/sequence/intrinsic/at.hpp>

Example
typedef vector<int,float,char> vec;
BOOST_MPL_ASSERT((boost::is_same<result_of::at<vec, boost::mpl::int_<1> >::type, float&>));


[5] result_of::at reflects the actual return type of the function at. Sequence(s) typically return references to its elements via the at function. If you want to get the actual element type, use result_of::value_at


PrevUpHomeNext