Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > template-id `hash_set<Tool*>' used as a declarator

Reply
Thread Tools

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

 
 
Vasileios
Guest
Posts: n/a
 
      11-04-2003
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

 
Reply With Quote
 
 
 
 
Rolf Magnus
Guest
Posts: n/a
 
      11-04-2003
Vasileios wrote:

> 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.

 
Reply With Quote
 
 
 
 
Vasileios
Guest
Posts: n/a
 
      11-04-2003
>>
>>typedef std::hash_set<Tool*> ToolSet;


>
> 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.

 
Reply With Quote
 
Rolf Magnus
Guest
Posts: n/a
 
      11-04-2003
Vasileios wrote:

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

>
>>
>> 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.


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.


 
Reply With Quote
 
Rolf Magnus
Guest
Posts: n/a
 
      11-04-2003
Rolf Magnus wrote:

> Vasileios wrote:
>
>>>>
>>>>typedef std::hash_set<Tool*> ToolSet;

>>
>>>
>>> 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.

>
> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
confusion about friend declarator Mark C++ 2 01-25-2005 12:45 AM
cv_qualifier in declarator grammar section xxx C++ 7 01-04-2005 09:53 PM
declarator name equals type name weirdness Andreas Leitner C Programming 3 12-06-2004 04:41 PM
Compile error: invalid type modifier within pointer declarator Per Johansson C++ 3 11-07-2004 09:43 AM
template-id 'VISDictionary<const char *, VISNamedContainerTypeCode *>' used as a declarator Gil C++ 0 12-10-2003 04:52 PM



Advertisments