#include <smultimap.hpp>
Classes | |
| class | iterator |
| class | wrap |
Public Types | |
| typedef std::unordered_multimap< K, wrap > | stlMap |
Public Member Functions | |
| ncnt | size () const |
| iterator | begin () const |
| iterator | end () const |
| iterator | begin (const K &key) const |
| iterator | begin (const K *key) const BY_SIDE_FUNC(key |
| iterator begin | begin ()) |
| iterator | rbegin () const |
| iterator | rend () const |
| iterator | rbegin (const K &key) const |
| iterator | rbegin (const K *key) const BY_SIDE_FUNC(key |
| iterator rbegin | rbegin ()) |
| void | insert (const K &key, V &&val) |
| void | erase (const K &key) |
| delete all elements matching given key. | |
| void | erase (const K *it) BY_SIDE_FUNC(erase) |
| void | erase (const iterator &it) |
| void | erase (const iterator *it) BY_SIDE_FUNC(erase) |
| void | erase (const iterator &from, const iterator &to) |
| void | erase (const iterator *from, const iterator &to) BY_SIDE_FUNC(from |
| void erase | void ()) |
| void | erase (const iterator &from, const iterator *to) BY_SIDE_FUNC(to |
| void | erase (from, *to) |
| void | void ()) |
| void | erase (const iterator *from, const iterator *to) BY_SIDE_FUNC(from &&to |
| void erase | void ()) |
| iterator | find (const K &key) const |
| void | clear () |
Public Attributes | |
| iterator begin | key |
| iterator rbegin | key |
| void erase | from |
Friends | |
| class | iterator |
smultimap: a multimap container class that preserves insertion order. in C++, a general map operates regardless of the insertion order when iteration is performed.
this class manages key and value as a pair like multimap, but when iteration is performed, it remembers the insertion order and iterates like a queue. This function is used in arguments capture features, etc., because when a nested function is exported to a closure, there is a requirement to capture and maintain the local scope at that time. Local variables that occurred after the time of capture should have no relation to the nested function.
in order to implement these functions quickly and effectively, a map container that remembers the insertion order is required.
the core ideas come from Oliver Schönrock and several great developers at bit.ly/41CwjLL