How should a size-limited stl-like container be implemented?

前端 未结 6 1908
生来不讨喜
生来不讨喜 2020-12-07 04:09

While refactoring, I wanted to change an array where entries are added to an std::vector, but for compatibility (persistency, downgrading,...), it still needs to have an upp

6条回答
  •  鱼传尺愫
    2020-12-07 04:22

    Have a look at this static_vector implementation which I found a while ago. I think it does exactly what you want.

    It's distributed under the very liberal boost license, so you're allowed to do just about anything with it.

提交回复
热议问题