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::vectors , 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

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -