Skip to content

An O(1) insertion/lookup dictionary that guarantees iteration in insertion-order for C++14 or above. Or you can say, "a FIFO-ordered associative container but O(1)" if you know what I mean ;)

License

cjxgm/fifo-map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

fifo-map and fifo-set

Copyright (C) Giumo Clanjor (哆啦比猫/兰威举), 2019-2020. Licensed under the MIT License.

A hash map and a hash set that guarantees iteration in insertion-order for C++14 or above. Or you can say, "a FIFO-ordered associative container" if you feel like it.

(Yes, it's similar to nlohmann::fifo_map, but this one uses std::unordered_map instead of std::map.)

It's basically an std::forward_list of key/value pairs, with a lookup index built using std::unordered_map.

It's a drop-in replacement for std::unordered_map if the interface you used was implemented.

Time complexity of all implemented operations are basically the same as std::unordered_map.

About

An O(1) insertion/lookup dictionary that guarantees iteration in insertion-order for C++14 or above. Or you can say, "a FIFO-ordered associative container but O(1)" if you know what I mean ;)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages