[bind10-dev] usage of "virtual" declarations in derived classes

zhanglikun zlkzhy at gmail.com
Wed Jul 21 09:28:55 UTC 2010


> class MoreDerived : public Derived {
> public:
>     void func();  // this will work equally with or without virtual in
"Derived".
> };
> 
> In this case the style I'm using is mostly a not so strong preference,
> so if it makes the code look awkward to other developers, I'd rather
> stop using it than adding comments on "why I use virtual here" in
> every use case of this style of virtual.  On the other hand, if this
> style makes sense, I think we should consistently use it throughout
> our code and add it as a general coding guideline on wiki, again,
> rather than making comments on it in every case where it's used.
> 
> Opinions?
> 


Agree

The explicit *virtual* tells the function will be overrided, not be hided.

But shall we try to hide some function in base class? 


Likun













More information about the bind10-dev mailing list