Template Class pair_t

Inheritance Relationships

Base Type

  • public std::pair< type1, type2 >

Class Documentation

template<typename type1, typename type2>
class pair_t : public std::pair<type1, type2>

Simple pair class extending std::pair.

Template Parameters:
  • type1 – Type of the first element.

  • type2 – Type of the second element.

Public Functions

inline pair_t()

Default constructor.

inline pair_t(const type1 &first_, const type2 &second_)

Constructs a pair from two elements.

Parameters:
  • first_ – Value copied into the pair first component.

  • second_ – Value copied into the pair second component.

inline pair_t(const std::pair<type1, type2> &p_)

Constructs from a std::pair.

Parameters:

p_ – Source std::pair copied into this wrapper.

Friends

inline friend std::ostream &operator<<(std::ostream &os_, const pair_t &p_)

Stream insertion for formatted printing.

Parameters:
  • os_ – Output stream receiving the formatted pair.

  • p_ – Pair value written to os_.

Returns:

Reference to os_ for stream chaining.