From: liam_herron on
Why does this compile when I define the body of the constructor in the
header versus
when I define the body of the constructor in the cpp file?

// Works

class A
{
public:
A() {f();}
virtual ~A() {}
virtual void f() = 0;
int a1_;
};

// Generates Linker Error
class A2
{
public:
A2();
virtual ~A2() {}
virtual void f() = 0;
int a2_;
};

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]