2

What's the difference between:

class A {
public:
void virtual method1() {...};
virtual void method2() {...};
};

The compiler (Edit: Apple LLVM 3.0)is not complaining about it. I know that method1 is not a virtual method (talking about polymorphism), then what is it?

thanks

subzero
  • 3,420
  • 5
  • 31
  • 40

1 Answers1

1

It doesn't matter how you order them. You can write funny stuff like

struct A {
  void virtual inline f() {}
  int static const unsigned value = 0u;
  int const typedef value_type;
};

The compiler doesn't care. The Standard doesn't care either.

Johannes Schaub - litb
  • 496,577
  • 130
  • 894
  • 1,212