How do you declare an interface in C++?

前端 未结 15 2565
借酒劲吻你
借酒劲吻你 2020-11-22 03:26

How do I setup a class that represents an interface? Is this just an abstract base class?

15条回答
  •  醉话见心
    2020-11-22 03:49

    A little addition to what's written up there:

    First, make sure your destructor is also pure virtual

    Second, you may want to inherit virtually (rather than normally) when you do implement, just for good measures.

提交回复
热议问题