Daily bit(e) of C++ | std::pair
Daily bit(e) of C++ #443, The heterogeneous container for storing two elements: std::pair.
The std::pair is a simple heterogeneous container for storing two elements, conceptually similar to std::tuple.
std::pair supports the std::tuple interface: std::get, std::tuple_size, std::tuple_element.
If you care about performance and work with trivially copyable types, consider an aggregate instead because std::pair isn't trivially copyable.