Any difference between "virtual void IBase :: Foo" and "virtual void Foo"?

I used the VisualAssistX parameter Implement Virtual Methods, and it generated:

class Base: public IBase
{
public:
    Base(void);
    ~Base(void);
    virtual void IBase::Foo();

I noticed that I can omit IBase, and the program is still compiled as follows:

    virtual void Foo();

If this is the same code? Why does VisualAssistX insert IBase::? Is it just a β€œcode style” to improve readability?

thank

+5
source share
3 answers

This will help eliminate ambiguity if you should get from several base classes with conflicting virtual functions. I suspect that is precisely why VisualAssistX wants to insert IBase::.

IBase:: . , .

, ++. . , ++.

+2

, . , . , . VA, , .

+1

, ++.

, ( "" ); , , .

VisualAssistX IBase::?

, , , IBase; , - , .

" " ?

; IBase, Base. .

+1

All Articles