Tiny class implementing faster std::string_view access to an unordered_map It exposes a limited number of methods of std::unordered_map. More...
#include <Tools.h>
Public Member Functions | |
FastStringUnorderedMap ()=default | |
FastStringUnorderedMap (std::initializer_list< std::pair< const std::string_view, T >> init) | |
auto | begin () |
auto | begin () const |
auto | end () |
auto | end () const |
auto | find (const std::string_view &key) |
auto | find (const std::string_view &key) const |
T & | operator[] (const std::string_view &key) |
Private Member Functions | |
std::unique_ptr< const char[]> | conv (std::string_view str) |
Private Attributes | |
std::vector< std::unique_ptr< const char[]> > | keys |
std::unordered_map< std::string_view, T > | map |
Tiny class implementing faster std::string_view access to an unordered_map It exposes a limited number of methods of std::unordered_map.
Others could be added. Importantly, when it is accessed via a std::string_view, the access does not require constructing a std::string and is thus faster. Deletion would be slower instead. It's not even implemented yet.
|
default |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
|
private |
Hosted by GitHub | 1.8.17 |