A
alex goldman
When compiling this code with
g++ -Wall -pedantic -ansi -c program.cpp # this is GCC-3.3.4
######################################
#include <vector>
class b {
public:
virtual void f() = 0;
};
class d : public b {
std::vector<int> v;
public:
void f() {}
};
#####################################
I get a warning:
program.cpp:8: warning: `class d' has virtual functions but non-virtual
destructor
Am I very confused about the presence of virtual functions in class d, or is
the compiler?
g++ -Wall -pedantic -ansi -c program.cpp # this is GCC-3.3.4
######################################
#include <vector>
class b {
public:
virtual void f() = 0;
};
class d : public b {
std::vector<int> v;
public:
void f() {}
};
#####################################
I get a warning:
program.cpp:8: warning: `class d' has virtual functions but non-virtual
destructor
Am I very confused about the presence of virtual functions in class d, or is
the compiler?