[I couldn’t find a proper answer to this. Kindly point me to proper links if this is already answered.]
I know that it illegal to do something like this,
class Base
{
public:
virtual void funcFoo() = 0 {} //illegal. should be defined outside the class body
virtual ~Base() {}
};
But this works fine on VS2008.
I want to know why this is disallowed by the standard?
On android, I see that I have to define the function inline like this,
inline void Base::funcFoo() {}
instead of just,
void Base::funcFoo() {}
what is the diference in implicit inlining and explicit inlining here? what is the compiler doing different?
I don’t think there is much of an answer to this. It came up once before (possibly on Usenet instead of SO — I don’t remember), so I did some looking. I didn’t really come up with much of anything. As far as I can tell, that’s how Bjarne originally devised it. Although it could be changed, I couldn’t find any proposals to the committee that it be changed, nor any indication that the committee has even debated, discussed, or considered it at all. My guess would be that it’s considered “good enough” the way it is, so nobody’s willing to put in much (any?) effort to change it.