Reasons for the absence of an abstract keyword

What is the reason for not using a keyword abstract

in C ++? Since I am reading the only way to declare a class abstract is to declare a pure virtual function in it, which is a little confusing. Why isn't there a more direct way to declare an abstract class?

+3


source to share


2 answers


I think the main reason is the reluctance to introduce a new keyword. Everyone tried to do it within the C keywords.



+1


source


Why is declaring a pure virtual function not "straight forward" enough? This way makes more sense than declaring the entire abstract class. The compiler should probably assume that all methods are virtual in this case. This will lead to additional overhead, etc.



In the end, if you like it, you can always switch to C # or a similar language.

0


source







All Articles