On Thursday, December 15, 2011 02:36:39 pm Romain de Bossoreille wrote:
Hi,
I was working filling the wiki about User Interface.
Is it normal that the file src/ui/dialog/panel-dialog.h does not have a .cpp? This file contains prototypes and source code of all functions of the class Inkscape::UI::Dialog::PanelDialogBase.
For clarity and compilation optimisation, would it be better to break it in a .cpp and .h files ?
Thanks,
It used to be the case that gcc required template classes to be implemented in a single translation unit (i.e., in the header) because dealing with templates in the linker is tricky (though possible -- I think the SGI MIPS compiler was able to handle it). I think that gcc still has this requirement, and that that is why the code is factored this way.
--Mark