Top "Stdmap" questions

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

How can I use std::maps with user-defined types as key?

I'm wondering why I can't use STL maps with user-defined classes. When I compile the code below, I get the …

c++ dictionary stl containers stdmap
map<string, string> how to insert data in this map?

I need to store strings in key value format. So am using Map like below. #include<map> using …

c++ stl stdstring stdmap
std::map default value

Is there a way to specify the default value std::map's operator[] returns when an key does not exist?

c++ stdmap
Find mapped value of map

Is there a way in C++ to search for the mapped value (instead of the key) of a map, and …

c++ dictionary find stdmap
How can I delete elements of a std::map with an iterator?

I would like to loop through an std::map and delete items based on their contents. How best would this …

c++ map iterator stdmap
How can I display the content of a map on the console?

I have a map declared as follows: map < string , list < string > > mapex ; list< string > …

c++ dictionary stl stdmap
Using char* as a key in std::map

I am trying to figure out why the following code is not working, and I am assuming it is an …

c++ map stdmap
Checking value exist in a std::map - C++

I know find method finds the supplied key in std::map and return an iterator to the element. Is there …

c++ iterator find stdmap
std::map insert or std::map find?

Assuming a map where you want to preserve existing entries. 20% of the time, the entry you are inserting is new …

c++ optimization stl stdmap
What is the difference between std::list<std::pair> and std::map in C++ STL?

What is the difference between std::list<std::pair> and std::map? Is there a find method for …

c++ stl stdmap std-pair stdlist