right place Template specialization

Andreas Pakulat apaku at gmx.de
Sat Jan 31 01:42:13 CET 2009


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?

Andreas

-- 
Learn to pause -- or nothing worthwhile can catch up to you.


More information about the Kde-windows mailing list