Skip to content

Commit 6a0b5e6

Browse files
authored
Abstract class needs at least one abstract method to be considered abstract (isocpp#2053)
The introduction of the method is needed, for instance, for constructions like std::is_abstract<AbstractBase>::value to be evaluated to true
1 parent 6966335 commit 6a0b5e6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

CppCoreGuidelines.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4938,6 +4938,7 @@ defined as defaulted.
49384938

49394939
class AbstractBase {
49404940
public:
4941+
virtual void foo() = 0; // at least one abstract method to make the class abstract
49414942
virtual ~AbstractBase() = default;
49424943
// ...
49434944
};

0 commit comments

Comments
 (0)