![]() |
Home | Libraries | People | FAQ | More |
Fusion pair
type is a half
runtime pair. A half runtime pair is similar to a std::pair
,
but, unlike std::pair
,
the first type does not have data. It is used as elements in _map_s,
for example.
template <typename First, typename Second> struct pair; namespace result_of { template <typename First, typename Second> struct first; template <typename First, typename Second> struct second; template <typename First, typename Second> struct make_pair; } template <typename First, typename Second> typename result_of::make_pair<First,Second>::type make_pair(Second const &);
Parameter |
Description |
---|---|
First |
The first type. This is purely a type. No data is held. |
Second |
The second type. This contains data. |
Notation
P
p
,
p2
F
,
S
s
S
o
i
Expression |
Semantics |
---|---|
|
The type of the first template parameter, |
|
The type of the second template parameter, |
|
Default construction. |
|
Construct a pair given value for the second type, |
|
Copy constructs a pair from another pair, |
|
Assigns a pair, p1, from another pair, |
make_pair<F>(s) |
Make a pair given the first type, |
|
Output |
|
Input |
|
Tests two pairs for equality. |
|
Tests two pairs for inequality. |
#include <boost/fusion/support/pair.hpp>
pair<int, char> p('X'); std::cout << p << std::endl; std::cout << make_pair<int>('X') << std::endl; assert((p == make_pair<int>('X')));
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias Schwinger |