Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Devirtualization in visual c++

Does visual c++ devirtualize a function for a pure class that only has one implementation? For example:

class ICar
{
public:
virtual void Break() = 0;
};

class CarImpl : public ICar
{
public:
virtual void Break(){ .... }
};
like image 367
piotrek Avatar asked Jan 15 '23 07:01

piotrek


1 Answers

EDIT: This answer is obsoleted by my second answer of 2012-10-20. I did not delete it to preserve the comments.

It is not possible for VC++ because other derived classes can be linked to the already compiled dll or exe module.

like image 87
farfareast Avatar answered Jan 25 '23 15:01

farfareast