Is it possible to forbid deriving from a class at compile time?

后端 未结 7 2113
甜味超标
甜味超标 2021-01-02 04:29

I have a value class according to the description in \"C++ Coding Standards\", Item 32. In short, that means it provides value semantics and does not have any virtual method

7条回答
  •  臣服心动
    2021-01-02 04:48

    Take a good look here.
    It's really cool but it's a hack.
    Wonder for yourself why stdlib doesn't do this with it's own containers.

提交回复
热议问题