Crates.io | cpp_map |
lib.rs | cpp_map |
version | 0.1.1 |
source | src |
created_at | 2021-07-02 19:15:28.350742 |
updated_at | 2021-07-29 20:42:38.977986 |
description | A simple C++ std::map emulator |
homepage | |
repository | https://github.com/eadf/cpp_map.rs |
max_upload_size | |
id | 417982 |
size | 73,366 |
A simple C++ std::map emulator for Rust. Probably not useful for anyone.
I needed a data structure that could emulate a C++ std::map, and it's pointer based iterators. More specifically it needs to emulate the insertion position hint functionality as the keys I intend to use are not entirely transitive. i.e., searching for insertion position from the head or tail makes a big difference.
I also needed to be able to replace the key of an already inserted item w/o altering the order. - Don't ask.
Another gotcha is that a C++ std::map::insert(key, value)
is a NOP if the key already exists, not even the new value will be used.
The current implementation uses a double linked Vec list, and it only supports sequential search.
Licensed under either of
at your option.