Is there an STL container that stores an array of elements in contiguous memory where the element size is specified at runtime?

后端 未结 3 457
青春惊慌失措
青春惊慌失措 2021-01-22 20:49

I\'m trying to create container that looks close to how my file spec works. It\'s like a vector but the type of the elements is defined by a hashtable.

If I knew the typ

3条回答
  •  别那么骄傲
    2021-01-22 21:52

    You could write your own class, but it'd be a serious pain. Better just go with vector (or boost::ptr_vector), which takes no effort on your part, and is easily readable to every programmer who comes along.

提交回复
热议问题