Skip to content

Glossary: Algorithms Beyond the Basics in C++

std::pair

Also written: pair

A type holding two values, accessed as `.first` and `.second`. Pairs compare by first, then second, so they sort and work in heaps.

Where the book teaches it

Related terms

auto [a, b] (structured binding)std::tuple