How do you declare an interface in C++?

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

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

15条回答
  •  -上瘾入骨i
    2020-11-22 03:50

    Here is the definition of abstract class in c++ standard

    n4687

    13.4.2

    An abstract class is a class that can be used only as a base class of some other class; no objects of an abstract class can be created except as subobjects of a class derived from it. A class is abstract if it has at least one pure virtual function.

提交回复
热议问题