How can I make KDevelop understand my template classes?

Daniel Alves Paladim daalpa at gmail.com
Wed Mar 19 10:20:08 GMT 2014


Exactly, Milian. I am talking about C++ template.
For example, I have the following two files,
*foo.h* (declaration)
template <class T>
class foo {
foo();
/*
Declaration of the methods
*/};
#include "foo.hpp

*foo.hpp* (implementation)
template <class T>
foo<T>::foo)() {}
/* and so on...*/

Now, when I work with this setting, when I am editing foo.hpp, I don't have
autocomplete anymore, the problems tab is full of errors. Is there no way
to fix this without modifying foo.h and foo.hpp? Is there a way to give a
hint to Kdevelop, so that he knows where the declaration of foo is?

Thanks,
Daniel


2014-03-19 9:41 GMT+00:00 Milian Wolff <mail at milianw.de>:

> On Wednesday 19 March 2014 02:30:10 Aleix Pol wrote:
> > On Tue, Mar 18, 2014 at 6:52 PM, Daniel Alves Paladim
> <daalpa at gmail.com>wrote:
> > > Dear all,
> > >
> > > KDevelop seems to be unable to "understand" my template class if I
> divide
> > > it in 2 files the following way, one file for the class declaration and
> > > another file for the implementation (which is included in the first).
> This
> > > difficults working on the implementation file. I wonder if there is any
> > > way
> > > to solve this problem without having to change the way I organize
> things.
> > >
> > > Thanks,
> > > Daniel Alves Paladim
> > >
> > > _______________________________________________
> > > KDevelop mailing list
> > > KDevelop at kde.org
> > > https://mail.kde.org/mailman/listinfo/kdevelop
> >
> > Maybe you should take a look at kdevelop/file_templates/classes/qobject/.
> > This one also uses different files.
>
> Or are you speaking about C++ template<typename Foo> stuff here? I think
> so.
>
> In that case where does it brake? When editing the ".hpp" file which does
> not
> include the ".h" file? Without proper code snippets we are left in the
> dark -
> please give us an example code.
>
> Bye
> --
> Milian Wolff
> mail at milianw.de
> http://milianw.de
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop/attachments/20140319/4723c7bb/attachment.html>


More information about the KDevelop mailing list