RAD Studio |  |

E2353: Class 'classname' is abstract because of 'member = 0' (C++)

This message is issued immediately after the "Cannot create instance of abstract class 'classname' error message and is intended to make it easier to figure out why a particular class is considered abstract by the compiler.

For example, consider the following example of an illegal attempt to instantiate an abstract class:

Copy Code

    struct VB
    {
    virtualvoid  f() = 0;
    virtualvoid  g() = 0;
    virtualvoid  h() = 0;
    };
    struct D1 : virtual VB
    {
    void   f();
    };
    struct D2 : virtual VB
    {
    void   h();
    };
    struct DD : D1, D2
    {
    }
    v;   // error 'DD' is an abstract class

The above code will cause the following two error messages:

Copy Code

    Error TEST.CPP 21: Cannot create instance of abstract class 'DD'

Copy Code

    Error TEST.CPP 21: Class 'DD' is abstract because of 'VB::g() = 0'

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!