Mark,

Yes there are templates, but also at least 3 non-template functions:

void PanelDialogBase::_propagateDocumentReplaced()
void PanelDialogBase::_propagateDesktopActivated()
void PanelDialogBase::_propagateDesktopDeactivated()

As far as I can tell templates still need to be implemented in the .h, there are some workarounds where developpers are placing them in a .cpp and then put a #include "XXXXX.cpp" in the .h but that's not very good style programming.

 
--
Romain de Bossoreille



De : Mark Voorhies <mark.voorhies@...1761....2508...>
À : inkscape-devel@lists.sourceforge.net
Envoyé le : Vendredi 16 Décembre 2011 3h49
Objet : Re: [Inkscape-devel] Inkscape::UI::Dialog::PanelDialogBase .cpp and .h file

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


------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for
developers. It will provide a great way to learn Windows Azure and what it
provides. You can attend the event by watching it streamed LIVE online. 
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/inkscape-devel