Community
Participate
Working Groups
template <class par1> class B { ... }; template <int par1,int par2> class C { ... }; template <int par1,int par2> class A { typedef B<C<par1,par2>> D; ... } In C/C++ projects tab and more importantly for autocompletion, D must be not just a typedef with nothing inside, but expanded to template <int par1,int par2> class B<C<par1,par2>> { }; and have all members and member functions inside. I work with a library where templates are typedefed inside templates with a recursion factor of up to 4, so it's really uncomfortable without help from IDE. Project is imported from automake.
I have completed your example and invoking content assist after 'x.' proposes 'a'. template <class par1> struct B { int a; }; template <int par1,int par2> struct C {}; template <int par1,int par2> struct A { typedef B<C<par1,par2>> D; }; void test() { A<1,2>::D x; x.a; // Content assist after x. }
(In reply to comment #1) > I have completed your example and invoking content assist after 'x.' proposes > 'a'. > > > template <class par1> struct B { > int a; > }; > template <int par1,int par2> struct C {}; > template <int par1,int par2> struct A { > typedef B<C<par1,par2>> D; > }; > > void test() { > A<1,2>::D x; > x.a; // Content assist after x. > } Hi Markus, That wasn't the actual problem code, just a description. To reproduce the problem, you need to use the library that I'm using: DUNE http://www.dune-project.org/index.html. Here's how you can replicate the issue: Download: http://www.dune-project.org/download/2.0/dune-common-2.0.tar.gz http://www.dune-project.org/download/2.0/dune-grid-2.0.tar.gz extract to DUNE directory somewhere. while in DUNE directory ./configure, make launch "dune-common/bin/duneproject" to create a new project: enter arbitrary name(for example "test"), dependancy on dune-common dune-grid, arbitrary version and email. launch "dune-common/bin/dunecontrol --only=test all" This will configure and make the test project with one source file in the src directory. Now in eclipse create a makefile project with existing code and select the src directory of test. add following inlclude: #include <dune/grid/sgrid.hh> and these lines inside main: typedef Dune::SGrid<2,2>::LeafGridView A1; typedef Dune::Grid<2,2,double,Dune::SGridFamily<2,2,double>>:: Partition<Dune::All_Partition>::LeafGridView A2; Now A1 and A2 are actually the same type, and A2 is even still several typedef expansions away from the actual type(so eclipse correctly expands typedef up to this level, just not after) But eclipse code assist works with A2:: and doesn't work with A1:: It for sure isn't the issue of the library, as everything compiles and runs correctly without errors or warnings.
forgot to mark as reopened
I am not working on a linux host, it'd be helpful if you can provide a self-contained example.
(In reply to Forrest from comment #2) > To reproduce the problem, you need to use the library that I'm using: > DUNE http://www.dune-project.org/index.html. I tried following your steps to set up a project using this library, but first I got C++11-related compiler errors when trying to build DUNE 2.0, and then, after building DUNE 2.3 (which didn't have errors), an error of the form "ERROR: could not find /dune.module". As Markus said, it would be best if you provided a self-contained example of the failure. This could take the form of a zipped Eclipse project or workspace, as long as all the dependencies are in the project/workspace.
If you're still seeing this, please feel free to reopen after providing a complete example.