This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: c++ virtual base classes


flatmax wrote:

> Yep - but there is no :
> static class VBase{};
> decleration allowed !!
>
> Which means it can't be inherited and must be a static variable ... not
> really the best and perhaps overlooked by the specs. ?

He said "static member", not "static class" or "static base class". Only
objects can be declared static, classes can't. You _do_ know the difference
between a class and an object don't you? :-)

What you want is this:

     class topLevel {
       public:
         static VBase vb;
     };

     static VBase topLevel::vb;

--
Branko Čibej                 <branko.cibej@hermes.si>
HERMES SoftLab, Litijska 51, 1000 Ljubljana, Slovenia
voice: (+386 61) 186 53 49   fax: (+386 61) 186 52 70



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]