right place Template specialization

Patrick Spendrin ps_ml at gmx.de
Sat Jan 31 02:46:45 CET 2009


Andreas Pakulat schrieb:
> Hi, 
> 
> I've got a tricky problem here and templates are still mysterious to me
> outside of the usage of QMap/QList&Co.
> 
> If you look at
> http://websvn.kde.org/trunk/KDE/kdevelop/plugins/languages/cpp/cppduchain/templatedeclaration.cpp?view=markup
> http://websvn.kde.org/trunk/KDE/kdevelop/plugins/languages/cpp/cppduchain/templatedeclaration.h?view=markup
> 
> You'll see
> virtual Declaration* resolve(const TopDUContext* /*topContext*/) const
> around line 273 in the header and a specialization of this method in line
> 1021. As you can see the function in the header asserts in all cases, the
> specialization does something useful.
> 
> Unfortunately for me MSVC always resolves to the non-specialized version in
> the header. The template parameter matches as far as I can see during
> debugging (no backtrace at hand right now), but msvc still uses the wrong
> one. 
> 
> I could "fix" it by moving the specialization into the header file, but
> that breaks compilation on linux/gcc.
> 
> Anybody have a hint for me whats going wrong here and why MSVC doesn't see
> the specialization in the .cpp?
What looks not right is that the template class should get exported. 
Normally template classes do not get exported (compare Qt 
QVector/QList), so I wonder why this should be needed here.
I am not sure how this should change anything though as you say it 
compiles fine.
> 
> Andreas
> 
Patrick


-- 
web:                 http://windows.kde.org
mailing list:        kde-windows at kde.org
irc:                 #kde-windows (irc.freenode.net)


More information about the Kde-windows mailing list