Is using std::vector< std> > an antipattern?

后端 未结 4 1407
醉话见心
醉话见心 2020-12-29 22:22

For a long time I was using std::vector and std::shared_ptr hand in hand. Recently I started using std::shared_ptr when

4条回答
  •  遥遥无期
    2020-12-29 23:23

    It is a valid way of storing immutable (and thus thread safe) objects, a building block for a per-element copy-on-write cache. Definitely not an anti-pattern.

提交回复
热议问题