---
name: "__gnu_parallel::_IteratorPair"
section: "3"
platform: "linux"
package: "gcc"
version: "16.2.1+r23+gd564253eb6c8-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/__gnu_parallel::_IteratorPair"
---

# \_\_gnu\_parallel::\_IteratorPair(3)

A pair of iterators. The usual iterator operations are applied to both child iterators.

## NAME

\_\_gnu\_parallel::\_IteratorPair\< \_Iterator1, \_Iterator2, \_IteratorCategory \> - A pair of iterators. The usual iterator operations are applied to both child iterators.

## SYNOPSIS

\#include \<iterator.h\>

Inherits **std::pair\< \_Iterator1, \_Iterator2 \>**.

### Public Types

typedef **std::iterator\_traits**\< \_Iterator1 \> **\_TraitsType**\
 typedef \_TraitsType::difference\_type **difference\_type**\
 typedef \_Iterator1 **first\_type**\
 The type of the first member.  typedef \_IteratorCategory **iterator\_category**\
 typedef \_IteratorPair \* **pointer**\
 typedef \_IteratorPair & **reference**\
 typedef \_Iterator2 **second\_type**\
 The type of the second member.  typedef void **value\_type**\

### Public Member Functions

**\_IteratorPair** (const \_Iterator1 &\_\_first, const \_Iterator2 &\_\_second)\
 constexpr **explicit** (!\_S\_convertible\< \_U1 &, \_U2 & \>()) **pair**(**pair**\< \_U1\
 constexpr **explicit** (!\_S\_convertible\< \_U1 &, \_U2 & \>()) **pair**(**pair**\< \_U1\
 constexpr \_U2 &&constexpr **explicit** (!\_S\_convertible\< \_U1 &, \_U2 & \>()) **pair**(**pair**\< \_U1\
 Converting constructor from a non-const pair\<U1, U2\> lvalue.  constexpr \_U2 &&constexpr **explicit** (!\_S\_convertible\< \_U1 &, \_U2 & \>()) **pair**(**pair**\< \_U1\
 Converting constructor from a non-const pair\<U1, U2\> lvalue.  constexpr **explicit** (!\_S\_convertible\< \_U1, \_U2 \>()) **pair**(\_U1 &&\
 constexpr **explicit** (!\_S\_convertible\< \_U1, \_U2 \>()) **pair**(\_U1 &&\
 constexpr **explicit** (!\_S\_convertible\< \_U1, \_U2 \>()) **pair**(\_U1 &&\_\_x\
 Constructor accepting two values of arbitrary types.  constexpr **explicit** (!\_S\_convertible\< \_U1, \_U2 \>()) **pair**(\_U1 &&\_\_x\
 Constructor accepting two values of arbitrary types.  constexpr **explicit** (!\_S\_convertible\< \_U1, \_U2 \>()) **pair**(**pair**\< \_U1\
 constexpr **explicit** (!\_S\_convertible\< \_U1, \_U2 \>()) **pair**(**pair**\< \_U1\
 constexpr \_U2 &constexpr **explicit** (!\_S\_convertible\< \_U1, \_U2 \>()) **pair**(**pair**\< \_U1\
 Converting constructor from a non-const pair\<U1, U2\> rvalue.  constexpr \_U2 &constexpr **explicit** (!\_S\_convertible\< \_U1, \_U2 \>()) **pair**(**pair**\< \_U1\
 Converting constructor from a non-const pair\<U1, U2\> rvalue.  constexpr **explicit** (!\_S\_convertible\< const \_Iterator1 &, const \_Iterator2 & \>()) **pair**(const type\_identity\_t\< \_Iterator1 \> &\_\_x\
 Constructor accepting lvalues of first\_type and second\_type.  constexpr **explicit** (!\_S\_convertible\< const \_Iterator1 &, const \_Iterator2 & \>()) **pair**(const type\_identity\_t\< \_Iterator1 \> &\_\_x\
 Constructor accepting lvalues of first\_type and second\_type.  constexpr **explicit** (!\_S\_convertible\< const \_U1 &, const \_U2 & \>()) **pair**(const **pair**\< \_U1\
 constexpr **explicit** (!\_S\_convertible\< const \_U1 &, const \_U2 & \>()) **pair**(const **pair**\< \_U1\
 constexpr \_U2 &&constexpr **explicit** (!\_S\_convertible\< const \_U1 &, const \_U2 & \>()) **pair**(const **pair**\< \_U1\
 Converting constructor from a const pair\<U1, U2\> lvalue.  constexpr \_U2 &&constexpr **explicit** (!\_S\_convertible\< const \_U1 &, const \_U2 & \>()) **pair**(const **pair**\< \_U1\
 Converting constructor from a const pair\<U1, U2\> lvalue.  constexpr **explicit** (!\_S\_convertible\< const \_U1, const \_U2 \>()) **pair**(const **pair**\< \_U1\
 constexpr **explicit** (!\_S\_convertible\< const \_U1, const \_U2 \>()) **pair**(const **pair**\< \_U1\
 constexpr \_U2 &constexpr **explicit** (!\_S\_convertible\< const \_U1, const \_U2 \>()) **pair**(const **pair**\< \_U1\
 Converting constructor from a const pair\<U1, U2\> rvalue.  constexpr \_U2 &constexpr **explicit** (!\_S\_convertible\< const \_U1, const \_U2 \>()) **pair**(const **pair**\< \_U1\
 Converting constructor from a const pair\<U1, U2\> rvalue.  constexpr **explicit** (!\_S\_convertible\_from\_pair\_like\< \_UPair \>()) **pair**(\_UPair &&)=delete\
 constexpr **explicit** (!\_S\_convertible\_from\_pair\_like\< \_UPair \>()) **pair**(\_UPair &&)=delete\
 constexpr \_U2 &&constexpr **explicit** (!\_S\_convertible\_from\_pair\_like\< \_UPair \>()) **pair**(\_UPair &&\_\_p)\
 constexpr \_U2 &&constexpr **explicit** (!\_S\_convertible\_from\_pair\_like\< \_UPair \>()) **pair**(\_UPair &&\_\_p)\
 constexpr **explicit** (\_\_not\_\< \_\_and\_\< \_\_is\_implicitly\_default\_constructible\< \_Iterator1 \>, \_\_is\_implicitly\_default\_constructible\< \_Iterator2 \> \> \>()) **pair**() noexcept(is\_nothrow\_default\_constructible\_v\< \_Iterator1 \> &&is\_nothrow\_default\_constructible\_v\< \_Iterator2 \>)\
 Default constructor.  constexpr **explicit** (\_\_not\_\< \_\_and\_\< \_\_is\_implicitly\_default\_constructible\< \_Iterator1 \>, \_\_is\_implicitly\_default\_constructible\< \_Iterator2 \> \> \>()) **pair**() noexcept(is\_nothrow\_default\_constructible\_v\< \_Iterator1 \> &&is\_nothrow\_default\_constructible\_v\< \_Iterator2 \>)\
 Default constructor.  constexpr \_U2 &&constexpr \_U2 &\_\_p **noexcept** (\_S\_nothrow\_constructible\< \_U1 &, \_U2 & \>())\
 constexpr \_U2 &&constexpr \_U2 &\_\_p **noexcept** (\_S\_nothrow\_constructible\< \_U1 &, \_U2 & \>())\
 constexpr \_U2 &constexpr \_U2 &&\_\_p **noexcept** (\_S\_nothrow\_constructible\< \_U1, \_U2 \>())\
 constexpr \_U2 &constexpr \_U2 &&\_\_p **noexcept** (\_S\_nothrow\_constructible\< \_U1, \_U2 \>())\
 constexpr \_U2 &&\_\_y **noexcept** (\_S\_nothrow\_constructible\< \_U1, \_U2 \>())\
 constexpr \_U2 &&\_\_y **noexcept** (\_S\_nothrow\_constructible\< \_U1, \_U2 \>())\
 constexpr const \_Iterator2 &\_\_y **noexcept** (\_S\_nothrow\_constructible\< const \_Iterator1 &, const \_Iterator2 & \>())\
 constexpr const \_Iterator2 &\_\_y **noexcept** (\_S\_nothrow\_constructible\< const \_Iterator1 &, const \_Iterator2 & \>())\
 constexpr \_U2 &&constexpr \_U2 &\_\_p **noexcept** (\_S\_nothrow\_constructible\< const \_U1 &, const \_U2 & \>())\
 constexpr \_U2 &&constexpr \_U2 &\_\_p **noexcept** (\_S\_nothrow\_constructible\< const \_U1 &, const \_U2 & \>())\
 constexpr \_U2 &constexpr \_U2 &&\_\_p **noexcept** (\_S\_nothrow\_constructible\< const \_U1, const \_U2 \>())\
 constexpr \_U2 &constexpr \_U2 &&\_\_p **noexcept** (\_S\_nothrow\_constructible\< const \_U1, const \_U2 \>())\
 **operator \_Iterator2** () const\
 \_IteratorPair **operator+** (difference\_type \_\_delta) const\
 \_IteratorPair & **operator++** ()\
 const \_IteratorPair **operator++** (int)\
 difference\_type **operator-** (const \_IteratorPair &\_\_other) const\
 \_IteratorPair & **operator--** ()\
 const \_IteratorPair **operator--** (int)\
 \_IteratorPair & **operator=** (const \_IteratorPair &\_\_other)\
 constexpr void **swap** (const **pair** &\_\_p) const noexcept(\_\_and\_v\< \_\_is\_nothrow\_swappable\< const \_Iterator1 \>, \_\_is\_nothrow\_swappable\< const \_Iterator2 \> \>)\
 constexpr void **swap** (const **pair** &\_\_p) const noexcept(\_\_and\_v\< \_\_is\_nothrow\_swappable\< const \_Iterator1 \>, \_\_is\_nothrow\_swappable\< const \_Iterator2 \> \>)\
 constexpr void **swap** (**pair** &\_\_p) noexcept(\_\_and\_\< \_\_is\_nothrow\_swappable\< \_Iterator1 \>, \_\_is\_nothrow\_swappable\< \_Iterator2 \> \>::value)\
 Swap the first members and then the second members.  constexpr void **swap** (**pair** &\_\_p) noexcept(\_\_and\_\< \_\_is\_nothrow\_swappable\< \_Iterator1 \>, \_\_is\_nothrow\_swappable\< \_Iterator2 \> \>::value)\
 Swap the first members and then the second members.

### Public Attributes

\_Iterator1 **first**\
 The first member.  \_Iterator1 **first**\
 The first member.  \_Iterator2 **second**\
 The second member.  \_Iterator2 **second**\
 The second member.

### Related Symbols

(Note that these are not member symbols.)

constexpr enable\_if\< \_\_and\_\< \_\_is\_swappable\< \_Iterator1 \>, \_\_is\_swappable\< \_Iterator2 \> \>::value \>::type **swap** (**pair**\< \_Iterator1, \_Iterator2 \> &\_\_x, **pair**\< \_Iterator1, \_Iterator2 \> &\_\_y) noexcept(noexcept(\_\_x.swap(\_\_y)))\
 constexpr enable\_if\< \_\_and\_\< \_\_is\_swappable\< \_Iterator1 \>, \_\_is\_swappable\< \_Iterator2 \> \>::value \>::type **swap** (**pair**\< \_Iterator1, \_Iterator2 \> &\_\_x, **pair**\< \_Iterator1, \_Iterator2 \> &\_\_y) noexcept(noexcept(\_\_x.swap(\_\_y)))\
 constexpr bool **operator==** (const **pair**\< \_Iterator1, \_Iterator2 \> &\_\_x, const **pair**\< \_U1, \_U2 \> &\_\_y)\
 Two pairs are equal iff their members are equal.  constexpr bool **operator==** (const **pair**\< \_Iterator1, \_Iterator2 \> &\_\_x, const **pair**\< \_U1, \_U2 \> &\_\_y)\
 Two pairs are equal iff their members are equal.  constexpr common\_comparison\_category\_t\< \_\_detail::\_\_synth3way\_t\< \_Iterator1, \_U1 \>, \_\_detail::\_\_synth3way\_t\< \_Iterator2, \_U2 \> \> **operator\<=\>** (const **pair**\< \_Iterator1, \_Iterator2 \> &\_\_x, const **pair**\< \_U1, \_U2 \> &\_\_y)\
 constexpr common\_comparison\_category\_t\< \_\_detail::\_\_synth3way\_t\< \_Iterator1, \_U1 \>, \_\_detail::\_\_synth3way\_t\< \_Iterator2, \_U2 \> \> **operator\<=\>** (const **pair**\< \_Iterator1, \_Iterator2 \> &\_\_x, const **pair**\< \_U1, \_U2 \> &\_\_y)\

## Detailed Description

### template\<typename \_Iterator1, typename \_Iterator2, typename \_IteratorCategory\>

class \_\_gnu\_parallel::\_IteratorPair\< \_Iterator1, \_Iterator2, \_IteratorCategory \>"A pair of iterators. The usual iterator operations are applied to both child iterators.

## Member Typedef Documentation

### typedef \_Iterator1 std::pair\< \_Iterator1, \_Iterator2 \>::first\_type \[inherited\]

The type of the first member.

### typedef \_Iterator2 std::pair\< \_Iterator1, \_Iterator2 \>::second\_type \[inherited\]

The type of the second member.

## Member Function Documentation

### \_U2 &&constexpr std::pair\< \_Iterator1, \_Iterator2 \>::explicit (!\_S\_convertible\< \_U1 &, \_U2 & \> ()) \[constexpr\], \[inherited\]

Converting constructor from a non-const pair\<U1, U2\> lvalue.

### \_U2 &&constexpr std::pair\< \_Iterator1, \_Iterator2 \>::explicit (!\_S\_convertible\< \_U1 &, \_U2 & \> ()) \[constexpr\], \[inherited\]

Converting constructor from a non-const pair\<U1, U2\> lvalue.

### std::pair\< \_Iterator1, \_Iterator2 \>::explicit (!\_S\_convertible\< \_U1, \_U2 \> ()) && \[constexpr\], \[inherited\]

Constructor accepting two values of arbitrary types.

### std::pair\< \_Iterator1, \_Iterator2 \>::explicit (!\_S\_convertible\< \_U1, \_U2 \> ()) && \[constexpr\], \[inherited\]

Constructor accepting two values of arbitrary types.

### \_U2 &constexpr std::pair\< \_Iterator1, \_Iterator2 \>::explicit (!\_S\_convertible\< \_U1, \_U2 \> ()) \[constexpr\], \[inherited\]

Converting constructor from a non-const pair\<U1, U2\> rvalue.

### \_U2 &constexpr std::pair\< \_Iterator1, \_Iterator2 \>::explicit (!\_S\_convertible\< \_U1, \_U2 \> ()) \[constexpr\], \[inherited\]

Converting constructor from a non-const pair\<U1, U2\> rvalue.

### std::pair\< \_Iterator1, \_Iterator2 \>::explicit (!\_S\_convertible\< const \_Iterator1 &, const \_Iterator2 & \> ()) const & \[constexpr\], \[inherited\]

Constructor accepting lvalues of first\_type and second\_type.

### std::pair\< \_Iterator1, \_Iterator2 \>::explicit (!\_S\_convertible\< const \_Iterator1 &, const \_Iterator2 & \> ()) const & \[constexpr\], \[inherited\]

Constructor accepting lvalues of first\_type and second\_type.

### \_U2 &&constexpr std::pair\< \_Iterator1, \_Iterator2 \>::explicit (!\_S\_convertible\< const \_U1 &, const \_U2 & \> ()) const \[constexpr\], \[inherited\]

Converting constructor from a const pair\<U1, U2\> lvalue.

### \_U2 &&constexpr std::pair\< \_Iterator1, \_Iterator2 \>::explicit (!\_S\_convertible\< const \_U1 &, const \_U2 & \> ()) const \[constexpr\], \[inherited\]

Converting constructor from a const pair\<U1, U2\> lvalue.

### \_U2 &constexpr std::pair\< \_Iterator1, \_Iterator2 \>::explicit (!\_S\_convertible\< const \_U1, const \_U2 \> ()) const \[constexpr\], \[inherited\]

Converting constructor from a const pair\<U1, U2\> rvalue.

### \_U2 &constexpr std::pair\< \_Iterator1, \_Iterator2 \>::explicit (!\_S\_convertible\< const \_U1, const \_U2 \> ()) const \[constexpr\], \[inherited\]

Converting constructor from a const pair\<U1, U2\> rvalue.

### std::pair\< \_Iterator1, \_Iterator2 \>::explicit (\_\_not\_\< \_\_and\_\< \_\_is\_implicitly\_default\_constructible\< \_Iterator1 \>, \_\_is\_implicitly\_default\_constructible\< \_Iterator2 \> \> \> ()) \[inline\], \[constexpr\], \[noexcept\], \[inherited\]

Default constructor.

### std::pair\< \_Iterator1, \_Iterator2 \>::explicit (\_\_not\_\< \_\_and\_\< \_\_is\_implicitly\_default\_constructible\< \_Iterator1 \>, \_\_is\_implicitly\_default\_constructible\< \_Iterator2 \> \> \> ()) \[inline\], \[constexpr\], \[noexcept\], \[inherited\]

Default constructor.

### void std::pair\< \_Iterator1, \_Iterator2 \>::swap (pair\< \_Iterator1, \_Iterator2 \> & \_\_p) \[inline\], \[constexpr\], \[noexcept\], \[inherited\]

Swap the first members and then the second members.

### void std::pair\< \_Iterator1, \_Iterator2 \>::swap (pair\< \_Iterator1, \_Iterator2 \> & \_\_p) \[inline\], \[constexpr\], \[noexcept\], \[inherited\]

Swap the first members and then the second members.

## Friends And Related Symbol Documentation

### common\_comparison\_category\_t\< \_\_detail::\_\_synth3way\_t\< \_Iterator1, \_U1 \>, \_\_detail::\_\_synth3way\_t\< \_Iterator2, \_U2 \> \> operator\<=\> (const pair\< \_Iterator1, \_Iterator2 \> & \_\_x, const pair\< \_U1, \_U2 \> & \_\_y) \[related\]

Defines a lexicographical order for pairs.

For two pairs of comparable types, P is ordered before Q if P.first is less than Q.first, or if P.first and Q.first are equivalent (neither is less than the other) and P.second is less than Q.second.

### common\_comparison\_category\_t\< \_\_detail::\_\_synth3way\_t\< \_Iterator1, \_U1 \>, \_\_detail::\_\_synth3way\_t\< \_Iterator2, \_U2 \> \> operator\<=\> (const pair\< \_Iterator1, \_Iterator2 \> & \_\_x, const pair\< \_U1, \_U2 \> & \_\_y) \[related\]

Defines a lexicographical order for pairs.

For two pairs of comparable types, P is ordered before Q if P.first is less than Q.first, or if P.first and Q.first are equivalent (neither is less than the other) and P.second is less than Q.second.

### bool operator== (const pair\< \_Iterator1, \_Iterator2 \> & \_\_x, const pair\< \_U1, \_U2 \> & \_\_y) \[related\]

Two pairs are equal iff their members are equal.

### bool operator== (const pair\< \_Iterator1, \_Iterator2 \> & \_\_x, const pair\< \_U1, \_U2 \> & \_\_y) \[related\]

Two pairs are equal iff their members are equal.

### enable\_if\< \_\_and\_\< \_\_is\_swappable\< \_Iterator1 \>, \_\_is\_swappable\< \_Iterator2 \> \>::value \>::type swap (pair\< \_Iterator1, \_Iterator2 \> & \_\_x, pair\< \_Iterator1, \_Iterator2 \> & \_\_y) \[related\]

Swap overload for pairs. Calls std::pair::swap().

**Note**

This std::swap overload is not declared in C++03 mode, which has performance implications, e.g. see https://gcc.gnu.org/PR38466

### enable\_if\< \_\_and\_\< \_\_is\_swappable\< \_Iterator1 \>, \_\_is\_swappable\< \_Iterator2 \> \>::value \>::type swap (pair\< \_Iterator1, \_Iterator2 \> & \_\_x, pair\< \_Iterator1, \_Iterator2 \> & \_\_y) \[related\]

Swap overload for pairs. Calls std::pair::swap().

**Note**

This std::swap overload is not declared in C++03 mode, which has performance implications, e.g. see https://gcc.gnu.org/PR38466

## Member Data Documentation

### \_Iterator1 std::pair\< \_Iterator1, \_Iterator2 \>::first \[inherited\]

The first member.

### \_Iterator1 std::pair\< \_Iterator1, \_Iterator2 \>::first \[inherited\]

The first member.

### \_Iterator2 std::pair\< \_Iterator1, \_Iterator2 \>::second \[inherited\]

The second member.

### \_Iterator2 std::pair\< \_Iterator1, \_Iterator2 \>::second \[inherited\]

The second member.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
