source:
downloads/boost_1_34_1/libs/mpl/doc/src/refmanual/pair.rst
@
29
| Last change on this file since 29 was 29, checked in by landauf, 17 years ago | |
|---|---|
| File size: 1.0 KB | |
pair
Synopsis
template<
typename T1
, typename T2
>
struct pair
{
typedef pair type;
typedef T1 first;
typedef T2 second;
};
Description
A transparent holder for two arbitrary types.
Header
#include <boost/mpl/pair.hpp>
Example
Count a number of elements in the sequence together with a number of negative elements among these.
typedef fold<
vector_c<int,-1,0,5,-7,-2,4,5,7>
, pair< int_<0>, int_<0> >
, pair<
next< first<_1> >
, if_<
less< _2, int_<0> >
, next< second<_1> >
, second<_1>
>
>
>::type p;
BOOST_MPL_ASSERT_RELATION( p::first::value, ==, 8 );
BOOST_MPL_ASSERT_RELATION( p::second::value, ==, 3 );
See also
Note: See TracBrowser
for help on using the repository browser.










