4 template<
class Key,
class Hash,
class Pred >
7 if( this->iterators.size() )
8 this->toinsert.insert( val );
10 this->items.insert( val );
13 template<
class Key,
class Hash,
class Pred >
16 this->toinsert.erase( val );
18 auto it = this->items.find( val );
20 if( it == this->items.end() )
23 for(
auto & iter : this->iterators )
27 this->items.erase( val );
30 template<
class Key,
class Hash,
class Pred >
33 auto & it = this->lock_begin();
35 while( it != this->items.end() )
37 Key
const & item = *it;
45 template<
class Key,
class Hash,
class Pred >
48 this->iterators.push_back( this->items.begin() );
49 return this->iterators.back();
53 template<
class Key,
class Hash,
class Pred >
56 this->iterators.push_back( this->items.find( val ) );
57 return this->iterators.back();
60 template<
class Key,
class Hash,
class Pred >
63 this->iterators.pop_back();
65 if( this->iterators.empty() )
67 this->items.insert( this->toinsert.begin(), this->toinsert.end() );
68 this->toinsert.clear();
72 template<
class Key,
class Hash,
class Pred >
75 return this->items.end();
78 template<
class Key,
class Hash,
class Pred >
81 return this->items.count( val ) || this->toinsert.count( val );
84 template<
class Key,
class Hash,
class Pred >
87 return this->items.size();
91 template<
class Key,
class Hash,
class Pred >
94 return this->items.empty();