ADC Home > Reference Library > Reference > Darwin > Miscellaneous User Space API Reference

 


stl_pair.h

Introduction

This is an internal header file, included by other library headers. You should not attempt to use it directly.



Functions

make_pair
pair
pair( __b)
pair(__p .)

make_pair


// _GLIBCXX_RESOLVE_LIB_DEFECTS 
// 181. make_pair() unintended behavior 
template<class _T1, class _T2> inline pair<_T1, _T2> make_pair(
    _T1 __x,
    _T2 __y) 
Parameters
x
The first object.
y
The second object.
Return Value

A newly-constructed pair<> object of the appropriate type.

The standard requires that the objects be passed by reference-to-const, but LWG issue #181 says they should be passed by const value. We follow the LWG by default.

Discussion

@brief A convenience wrapper for creating a pair from two objects.


pair


pair() : first(), second() 
Discussion

The default constructor creates @c first and @c second using their * respective default constructors.


pair( __b)


pair(
    const _T1& __a,
    const _T2& __b) : first(
    __a), second(
    __b) 
Discussion

Two objects may be passed to a @c pair constructor to be copied.


pair(__p .)


template<class _U1, class _U2> pair(
    const pair<_U1, _U2>& __p) : first(
    __p.first), second(
    __p.second) 
Discussion

There is also a templated copy ctor for the @c pair class itself.

Last Updated: 2006-06-20