Top "Std-pair" questions

A std::pair is an ordered, heterogeneous sequence of exactly two objects (it is a special case of std::tuple).

converting a variable name to a string in C++

I'd like to output some data to a file. For example assume I have two vectors of doubles: vector<…

c++ string variables map std-pair
Difference between std::pair and std::tuple with only two members?

Is there a difference between an std::pair and an std::tuple with only two members? (Besides the obvious that …

c++ visual-studio-2010 tuples std-pair stdtuple
C++ vector of pairs initialization

I have vector< pair<int, int>> myVec (N); I want to have all pairs initialized to …

c++ vector std-pair
Pair inside priority queue

I am trying to store pairs in priority queue and I am using a compare function that compares second value …

c++ stl priority-queue std-pair
How can I make an unordered set of pairs of integers in C++?

The following program does not compile an unordered set of pairs of integers, but it does for integers. Can unordered_…

c++ std-pair unordered-set
How can I store a pair of numbers in C++?

I'm trying to learn C++ and right now I'm writing a program that needs to output a list of pairs …

c++ stl std-pair
c++ - How to get first and second element of pair if used as key in map?

I was trying to get first and second element of pair when i am using pair as key in map.…

c++ maps std-pair
Does C++ provide a "triple" template, comparable to pair<T1, T2>?

Does C++ have anything like std::pair but with 3 elements? For example: #include <triple.h> triple<int, …

c++ stl std-pair
Using pair<int, int> as key for map

Based on a previous question, I am trying to create a map using a pair of integers as a key …

c++ map std-pair
How do I initialize a const std::pair?

Let's say that I've got a : #include <utility> using namespace std; typedef pair<int, int> my_…

c++ stl std-pair