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

前端 未结 7 1116
一生所求
一生所求 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.

提交回复
热议问题