Top "Std-pair" questions

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

STL map insertion efficiency: [] vs. insert

There are two ways of map insertion: m[key] = val; Or m.insert(make_pair(key, val)); My question is, …

c++ stl map insert std-pair
union members may not have constructors, but `std::pair` okay?

union members may not have destructors or constructors. So I can't template the following class Foo on my own MyClass …

c++ constructor unions std-pair
Is there a NULL equivalent for pairs in C++?

What would I want to use instead of NULL if I have an unassigned pair in C++? As an example, …

c++ std-pair
How to initialize a vector of pair of string,string in a c++ class?

How do I initialize a vector of a pair of strings in a C++ class? I tried several things but …

c++ c++11 vector initialization std-pair
why do i need to use piecewise_construct in map::emplace for single arg constructors of noncopyable objects?

The following code will not compile on gcc 4.8.2. The problem is that this code will attempt to copy construct an …

c++ c++11 map std-pair emplace
Why was pair range access removed from C++11?

I just discovered that at one point, the C++11 draft had std::begin/std::end overloads for std::pair that …

c++ foreach c++11 range std-pair