Try this code:
class Movie
{
public:
Movie(int i)
{
this->i=i;
}
~Movie(){ }
virtual void show() const =0;
private:
int i;
};
///////////////////////////////////////////////
int main(int argc,char **argv)
{
(Movie(6)).show(); // this line compiles Ok !
return 1;
}
MSVC allows you to create a temporarly object of an abstract class!
It failes, however, at run time!
What a shame !
class Movie
{
public:
Movie(int i)
{
this->i=i;
}
~Movie(){ }
virtual void show() const =0;
private:
int i;
};
///////////////////////////////////////////////
int main(int argc,char **argv)
{
(Movie(6)).show(); // this line compiles Ok !
return 1;
}
MSVC allows you to create a temporarly object of an abstract class!
It failes, however, at run time!
What a shame !