because "= 0" create “undefined reference” when using a class as interface with virtual destructor.
Please read http://stackoverflow.com/questions/2555033 for example. This guy had the same problem I have.
Thanks for applying all the patches. I'm not absolutly sure this one will not create bad shadow effect (for exemple if someone want to define a virtual destrutor) but history will say. Other patches will come and I just open 2 threads on discussion because I have 2 problems that can not remove easily.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As I said, "history will say". I'm sorry, I think this idea is bad. With the example enclosed, the behavious is different with or without the virtual destructor. So if destructor is "virtual ~aaa () {};" I can't define the following destructor :
aaa::aaa ()
{
std::cout << "début\n";
}
but with "virtual ~aaa () = 0;", it's okay.
Don't you thing that we should reverse this commit (or changing the patch to disabling the "{}" or "= 0" for the destructor) ? And to avoid the bug, the user will have to write an empty method for the destructor.
Thanks for providing this patch. I applied it on git master in commit 218790d
Thanks for applying all the patches. I'm not absolutly sure this one will not create bad shadow effect (for exemple if someone want to define a virtual destrutor) but history will say. Other patches will come and I just open 2 threads on discussion because I have 2 problems that can not remove easily.
As I said, "history will say". I'm sorry, I think this idea is bad. With the example enclosed, the behavious is different with or without the virtual destructor. So if destructor is "virtual ~aaa () {};" I can't define the following destructor :
aaa::aaa ()
{
std::cout << "début\n";
}
but with "virtual ~aaa () = 0;", it's okay.
Don't you thing that we should reverse this commit (or changing the patch to disabling the "{}" or "= 0" for the destructor) ? And to avoid the bug, the user will have to write an empty method for the destructor.
Last edit: LE GARREC Vincent 2014-06-22
Proposal patch for this bug.
Thanks for providing the new patch. I applied it on git master in commit a54728.