Top "Stdmap" questions

std::map is a class in the C++ Standard Library.

Why does std::map operator[] create an object if the key doesn't exist?

I'm pretty sure I already saw this question somewhere (comp.lang.c++? Google doesn't seem to find it there either) …

c++ stdmap design-rationale
C++ std::map or std::set - efficiently insert duplicates

I have a bunch of data full of duplicates and I want to eliminate the duplicates. You know, e.g. [1, 1, 3, 5, 5, 5, 7] …

c++ performance stdmap stdset
C++: Inheriting from std::map

I want to inherit from std::map, but as far as I know std::map hasn't any virtual destructor. Is …

c++ inheritance stdmap virtual-destructor
When a `key/value` is inserted into a `std::map`, does it make its own copy of the objects?

This is inspired by an Item in Effective C# first edition, warning about overriding GetHashCode() naively. Sorry, I do not …

c++ stl stdmap
Function that returns map in c++

Can someone please give an actual example of function that returns map in c++. I tried answers from other posts …

c++ function return stdmap cpprest-sdk
C++ const std::map reference fails to compile

Is there a reason why passing a reference to a std::map as const causes the [] operator to break? I …

c++ find std operator-keyword stdmap
Is is possible to use std::map in C++ with a class without any copy operator?

I'm using a Class (Object) that doesn't have any copy operator : it basically cannot be copied right now. I have …

c++ constructor copy-constructor stdmap
How to pass std::map as a default constructor parameter

I haven't been able to figure this out. It's easy to create two ctors but I wanted to learn if …

c++ constructor default-value stdmap
map, lambda, remove_if

So, i've problem with std::map, lambda and stl algorithm(remove_if). Actually, same code with std::list or std::…

c++ lambda c++11 stdmap stl-algorithm
Map with multiple keys in C++

I want to store data by both, their name and their index. In other words, I want to map string …

c++ key std stdmap compound-key