#include <map>#include <stdexcept>

Go to the source code of this file.
Functions | |
| template<typename K , typename V > | |
| const V & | map_get_value_default (const std::map< K, V > &m, const K &key, const V &val) |
| template<class M > | |
| M::mapped_type | at (const M &map, const typename M::key_type &key) |
| Emulation for C++11's std::map::at(). | |
| M::mapped_type at | ( | const M & | map, | |
| const typename M::key_type & | key | |||
| ) | [inline] |
Emulation for C++11's std::map::at().
Acts like return map[key], but can be used on const map, and if the key doesn't exist will throw an exception instead of adding the key.
A non-official reference can be found here: http://en.cppreference.com/w/cpp/container/map/at
| std::out_of_range | When the key is not in the map. |
| map | The map search into. | |
| key | The key to search for. |
Definition at line 53 of file map_utils.hpp.
Referenced by wb::move::calculate_new_route(), gui2::contains(), game_display::draw_movement_info(), terrain_filter::match_internal(), wb::recall::recall(), gui2::side_controller::show_nicks_list(), gui2::tmp_change_control::controller::show_sides_list(), gui2::sort(), and unit_weapons().

| const V& map_get_value_default | ( | const std::map< K, V > & | m, | |
| const K & | key, | |||
| const V & | val | |||
| ) |
Definition at line 21 of file map_utils.hpp.
| Generated by doxygen 1.7.1 on Fri May 25 2012 01:08:29 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |