C++ vector with dynamic item size

前端 未结 9 2319
无人及你
无人及你 2021-01-14 16:54

the C++ STL vector has a lot of decent properties, but only works when the size of each item is known at run-time.

I would like to have a vector class that features

9条回答
  •  不要未来只要你来
    2021-01-14 17:26

    Create a class that contains three vectors: one for ints, one for doubles, and one that has an entry for each item to tell the type of the corresponding item and its index in the corresponding vector.

提交回复
热议问题