mdds
Loading...
Searching...
No Matches
mdds::ref_pair< T1, T2 > Struct Template Reference

#include <ref_pair.hpp>

Public Types

using first_type = std::add_lvalue_reference_t<T1>
using second_type = std::add_lvalue_reference_t<T2>

Public Member Functions

 ref_pair (first_type _first, second_type _second)
 ref_pair (const ref_pair &other)=default
bool operator== (const std::pair< std::decay_t< T1 >, std::decay_t< T2 > > &other) const
bool operator== (const ref_pair &other) const
ref_pair * operator-> ()

Public Attributes

first_type first
second_type second

Detailed Description

template<typename T1, typename T2>
struct mdds::ref_pair< T1, T2 >

Pair of references to two existing values. It is primarily used as the value type of an iterator that needs to reference a key-value pair stored in a container without copying it.

It is comparable with a std::pair that holds the corresponding decayed value types.