Empirical
Namespaces | Functions
map_utils.h File Reference

A set of simple functions to manipulate maps. More...

#include <map>
#include <unordered_map>

Go to the source code of this file.

Namespaces

 emp
 If we are in emscripten, make sure to include the header.
 

Functions

template<class MAP_T , class KEY_T >
bool emp::Has (const MAP_T &in_map, const KEY_T &key)
 Take any map type, and run find to determine if a key is present. More...
 
template<class MAP_T , class KEY_T >
auto emp::Find (const MAP_T &in_map, const KEY_T &key, const typename MAP_T::mapped_type &dval)
 
template<class MAP_T , class KEY_T >
const auto & emp::FindRef (const MAP_T &in_map, const KEY_T &key, const typename MAP_T::mapped_type &dval)
 
template<typename A , typename B >
constexpr std::pair< B, A > emp::flip_pair (const std::pair< A, B > &p)
 Take an std::pair<A,B> and return the flipped pair std::pair<B,A> More...
 
template<typename A , typename B >
std::multimap< B, A > emp::flip_map (const std::map< A, B > &src)
 Take an std::map<A,B> and return the flipped map (now multimap to be safe): std::multimap<B,A> More...
 

Detailed Description

A set of simple functions to manipulate maps.

Note
This file is part of Empirical, https://github.com/devosoft/Empirical
Date
2016-2017
Note
Status: BETA