Is it okay to inherit implementation from STL containers, rather than delegate?

前端 未结 7 1011
一生所求
一生所求 2020-11-22 07:15

I have a class that adapts std::vector to model a container of domain-specific objects. I want to expose most of the std::vector API to the user, so that they may use famili

相关标签:
7条回答
  • 2020-11-22 07:55

    The forwarding methods will be inlined away, anyhow. You will not get better performance this way. In fact, you will likely get worse performance.

    0 讨论(0)
提交回复
热议问题