template-id `hash_set<Tool*>' used as a declarator

V

Vasileios

Hello could someone help me please.


I have the following class definition

#include <ext/hash_set>
#include "tool.h"

class ToolContainer : public QObject
{

public:

typedef std::hash_set<Tool*> ToolSet;
....
....
....


and when I compile I get the following:


toolcontainer.h:9: template-id `hash_set<Tool*>' used as a declarator
toolcontainer.h:9: parse error before `;' token



Any ideas why and how I could correct this error?

I am using GCC 3.27
 
R

Rolf Magnus

Vasileios said:
Hello could someone help me please.


I have the following class definition

#include <ext/hash_set>
#include "tool.h"

class ToolContainer : public QObject
{

public:

typedef std::hash_set<Tool*> ToolSet;
...
...
...


and when I compile I get the following:


toolcontainer.h:9: template-id `hash_set<Tool*>' used as a declarator
toolcontainer.h:9: parse error before `;' token

There is no standard template 'hash_set', so are you sure that it's in
namespace std? It wouldn't be allowed to.
Any ideas why and how I could correct this error?

I am using GCC 3.27

There is no version 3.27 of gcc. See http://gcc.gnu.org/releases.html
for a list of all gcc releases.
 
V

Vasileios

There is no standard template 'hash_set', so are you sure that it's in
namespace std? It wouldn't be allowed to.


ok
I tried with
typedef hash_set<Tool*> ToolSet;

but I get exactly the same error.


V.Z.
 
R

Rolf Magnus

Vasileios said:
ok
I tried with
typedef hash_set<Tool*> ToolSet;

but I get exactly the same error.

Ok, I had a look into gcc's has_set header (which you could have done
easily too), and found out that hash_list is in namespace __gnu_cxx.
 
R

Rolf Magnus

Rolf said:
Ok, I had a look into gcc's has_set header (which you could have done
easily too), and found out that hash_list is in namespace __gnu_cxx.

Sorry, of course I meant hash_set.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,227
Latest member
Daniella65

Latest Threads

Top