30 #ifndef LBANN_PEEK_MAP_HPP_INCLUDED 31 #define LBANN_PEEK_MAP_HPP_INCLUDED 45 template <
class KEY_T,
47 class CMP_T = std::less<KEY_T>
49 VAL_T
peek_map(
const std::map<KEY_T, VAL_T, CMP_T>& map_to_peek,
53 using map_to_peek_t = std::map<KEY_T, VAL_T, CMP_T>;
54 typename map_to_peek_t::const_iterator it = map_to_peek.find(idx);
55 if (it == map_to_peek.cend()) {
67 template <
class KEY_T,
69 class CMP_T = std::less<KEY_T>
71 VAL_T
peek_map(
const std::map<KEY_T, VAL_T, CMP_T>& map_to_peek, KEY_T idx)
73 using map_to_peek_t = std::map<KEY_T, VAL_T, CMP_T>;
74 typename map_to_peek_t::const_iterator it = map_to_peek.find(idx);
75 if (it == map_to_peek.cend()) {
89 template <
class KEY_T,
91 class HASH_T = std::hash<KEY_T>,
92 class KEYeq_T = std::equal_to<KEY_T>
95 const std::unordered_map<KEY_T, VAL_T, HASH_T, KEYeq_T>& map_to_peek,
99 using map_to_peek_t = std::unordered_map<KEY_T, VAL_T, HASH_T, KEYeq_T>;
100 typename map_to_peek_t::const_iterator it = map_to_peek.find(idx);
101 if (it == map_to_peek.cend()) {
113 template <
class KEY_T,
115 class HASH_T = std::hash<KEY_T>,
116 class KEYeq_T = std::equal_to<KEY_T>
119 const std::unordered_map<KEY_T, VAL_T, HASH_T, KEYeq_T>& map_to_peek,
122 using map_to_peek_t = std::unordered_map<KEY_T, VAL_T, HASH_T, KEYeq_T>;
123 typename map_to_peek_t::const_iterator it = map_to_peek.find(idx);
124 if (it == map_to_peek.cend()) {
132 #endif // LBANN_PEEK_MAP_HPP_INCLUDED VAL_T peek_map(const std::map< KEY_T, VAL_T, CMP_T > &map_to_peek, KEY_T idx, bool &found)