TITLE: virtuals and mixin classes (Newsgroups: comp.lang.c++.moderated, 19 Jan 97) KUEHL: kuehl@uzwil.informatik.uni-konstanz.de (Dietmar Kuehl) >in de.comp.lang.c++, the following disagreement came up: Given a base >class with two abstract virtual functions from which two classes derive >virtually each of which overrides one of the two functions. Then, a >class is derived from these two classes. The question is: Is the latter >class abstract or is it not? Here is an example: > > struct B { > void virtual f1() = 0; > void virtual f2() = 0; > }; > struct D1: virtual B { void f1() {}; }; > struct D2: virtual B { void f2() {}; }; > struct F: D1, D2 { }; > >The question is whether the class 'F' is abstract. Here are the two >different positions: ... CLAMAGE: stephen.clamage@Eng.Sun.COM (Steve Clamage) I don't see any room for a difference of opinion. An abstract class is one which has at least one virtual function for which the final overrider is pure virtual (10.4, Abstract classes). Base classes D1 and D2 are abstract, because each has (by inheritance) one pure virtual function which is not overridden. Class F has (by inheritance) two virtual functions: f1() and f2(). In class F, the final overriders of f1() and f2() are, respectively, D1::f1() and D2::f2(). Neither of the final overriders is pure virtual. Thus, F is not an abstract class.