How implement a custom std collection in C++? -
i want implement custom collection data structure in std style. there similar question on site, guy explicitly asking not using given std functionality.
the implementation should compatible rest of standard library , provide same interface, example iterators , type traits. base class should inherit , class have implement?
to provide information actual data structure, hash map values stored continuously in memory. internally, use 2 std::vector
s , 1 std::unordered_map
.
which base class should inherit from
none. standard containers not polymorphic; interface requirements informally specified in terms of expressions must supported. (in future, might formally specified "concepts"; that's not part of language yet.)
what class have implement?
see [container.requirements] section of c++ standard (currently section 23.2 of c++11); in particular tables specifying operations various container types must support. hash map, should support requirements "unordered associative containers".
Comments
Post a Comment