SpiecsEngine
 
Loading...
Searching...
No Matches

◆ for_each() [1/2]

template<typename K , typename V >
template<typename F >
void scl::linked_unordered_map< K, V >::for_each ( F && fn)

Iter the container in order.

Parameters
[in]fnThe function of how to iter the container.

The function defines how to iter.

Parameters
[in]keyK the key.
[in]valueV the value.
Returns
Retunrs True if want break this for loop.

Definition at line 261 of file LinkedUnorderedMap.h.

262 {
263 std::shared_lock<std::shared_mutex> lock(m_Mutex);
264
265 for (const K& key : m_Keys)
266 {
273 if(fn(key, m_Map[key])) break; //Break If want.
274 }
275 }
std::shared_mutex m_Mutex
Mutex for this container.
std::unordered_map< K, V > m_Map
std::list< K > m_Keys
The container keeps iter in order.