Re: Call to a virtual method crashes
From: Doug Harrison [MVP] (dsh_at_mvps.org)
Date: 02/15/05
- Next message: Frank Hickman [MVP]: "Re: Call to a virtual method crashes"
- Previous message: Doug Harrison [MVP]: "Re: Call to a virtual method crashes"
- In reply to: Frank Hickman [MVP]: "Re: Call to a virtual method crashes"
- Next in thread: Frank Hickman [MVP]: "Re: Call to a virtual method crashes"
- Reply: Frank Hickman [MVP]: "Re: Call to a virtual method crashes"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 14 Feb 2005 21:34:51 -0600
Frank Hickman [MVP] wrote:
>You've changed the functions virtualness. You need to declare them virtual
>in both the base and derived class.
It doesn't matter. For better or worse, the following are equivalent:
struct X
{
virtual void f();
};
struct Y1 : X
{
virtual void f();
};
struct Y2 : X
{
void f();
};
Both Y1::f and Y2::f override X::f.
-- Doug Harrison Microsoft MVP - Visual C++
- Next message: Frank Hickman [MVP]: "Re: Call to a virtual method crashes"
- Previous message: Doug Harrison [MVP]: "Re: Call to a virtual method crashes"
- In reply to: Frank Hickman [MVP]: "Re: Call to a virtual method crashes"
- Next in thread: Frank Hickman [MVP]: "Re: Call to a virtual method crashes"
- Reply: Frank Hickman [MVP]: "Re: Call to a virtual method crashes"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|