Compilation error when returning 2D vector

I have written an accessor function in which I want to return a 2D vector member variable:

1
2
3
4
5
6
7
8
9
10
11
12
13
class GrilleDeJeu
{
public:
    std::vector< std::vector<Jeton> > grille() const;

private:
    std::vector< std::vector<Jeton> > m_grilleDeJeu;
};

inline std::vector< std::vector<Jeton> > GrilleDeJeu::grille() const
{
	return m_grilleDeJeu;
}


When I do this, I get the following compilation error which I don't understand:

could not convert ‘((const p4base::GrilleDeJeu*)this)->p4base::GrilleDeJeu::m_grilleDeJeu’ from ‘const std::vector<std::vector<p4base::Jeton> >’ to ‘p4base::GrilleDeJeu’

Whats wrong with my member function? It seems to me that everything is legit...

Thanks
> When I do this
foo.cpp:4:10: error: ‘vector’ in namespace ‘std’ does not name a template type
     std::vector< std::vector<Jeton> > grille() const;
          ^
foo.cpp:7:10: error: ‘vector’ in namespace ‘std’ does not name a template type
     std::vector< std::vector<Jeton> > m_grilleDeJeu;
          ^
foo.cpp:10:13: error: ‘vector’ in namespace ‘std’ does not name a template type
 inline std::vector< std::vector<Jeton> > GrilleDeJeu::grille() const
             ^
bother yourself to create a minimal example that does reproduce your issue.
ne555: minimal example with int works. I restarted Eclipse and refreshed everything and the error was gone.

Thanks
Topic archived. No new replies allowed.