Crate cpp_map

Crate cpp_map 

Source
Expand description

A simple C++ std::map emulator for Rust.

This crate provides a data structure that emulates C++’s std::map, particularly its pointer-based cursors/iterators.

Key features replicated from C++:

  • std::map::insert(key, value) is a no-op if the key already exists (the new value isn’t even used)

Two implementations are provided:

  • Skip list: O(log n) search and insert, O(1) sequential access
  • Linked list: O(n) search and insert, O(1) sequential access

Note: For mostly position/hint-based operations, the linked list implementation will be faster.

Modules§

linkedlist
prelude
skiplist

Enums§

CppMapError
The Error type of the library

Traits§

IsEqual
IsLessThan