fficxx icon indicating copy to clipboard operation
fficxx copied to clipboard

Name conflict due to ambigious Destructor

Open wavewave opened this issue 6 years ago • 3 comments

Destructor introduces a virtual method delete. But since every deletable class has the method, we have a big name conflict. We had better revert old IDeletable superclass.

wavewave avatar Jun 25 '18 04:06 wavewave

A workaround now is to define an abstract class Deletable explicitly and make every class its subclass. See https://github.com/wavewave/hs-ogdf/commit/990df1baca6d25a451c85b4c1edfc2b513b79d86

wavewave avatar Jun 25 '18 06:06 wavewave

deletable approach works really well. and now I put IDeletable in stdcxx as a common dependency. By the way, not all C++ classes are deletable since some define destructor as a private method. We can control this by just not inheriting IDeletable.

wavewave avatar Jul 01 '18 08:07 wavewave

delete function name for ordinary class and template class is not consistent. For ordinary class, it's delete. For template class T, it's deleteT.

wavewave avatar Aug 24 '18 22:08 wavewave