C++ abstract class without pure virtual functions?

前端 未结 3 550
Happy的楠姐
Happy的楠姐 2020-12-01 15:44

I have a base class

class ShapeF
{
public:
    ShapeF();
    virtual ~ShapeF();

    inline void SetPosition(const Vector2& inPosition) { mPosition.Set(i         


        
3条回答
  •  广开言路
    2020-12-01 16:36

    If your compiler is Visual C++ then there is also an "abstract" keyword:

    class MyClass abstract
    {
        // whatever...
    };
    

    Though AFAIK it will not compile on other compilers, it's one of Microsoft custom keywords.

提交回复
热议问题