greg7mdp / parallel-hashmap

A family of header-only, very fast and memory-friendly hashmap and btree containers.
https://greg7mdp.github.io/parallel-hashmap/
Apache License 2.0
2.47k stars 234 forks source link

Missing `front()`, `back()` in Btree containers #177

Closed HolyBlackCat closed 1 year ago

HolyBlackCat commented 1 year ago

A minor issue: Btree containers lack front() and back() methods (returning references to first and last elements respectively), that their std:: counterparts do have.

HolyBlackCat commented 1 year ago

My bad, std::set doesn't have those too... Strange.

greg7mdp commented 1 year ago

I think because the standard differentiates sequence and associative containers, and only sequence containers have front/back. Maybe because with a vector you know when you change the front or back, with push_back() for example, while with an associative container the insertion of any element may change the front or back.

greg7mdp commented 1 year ago

Thank you for the comment anyways @HolyBlackCat !