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

Discussion in 'C++' started by Vasileios, Nov 4, 2003.

  1. Vasileios

    Vasileios Guest

    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
     
    Vasileios, Nov 4, 2003
    #1
    1. Advertising

  2. Vasileios

    Rolf Magnus Guest

    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.
     
    Rolf Magnus, Nov 4, 2003
    #2
    1. Advertising

  3. Vasileios

    Vasileios Guest

    >>
    >>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.
     
    Vasileios, Nov 4, 2003
    #3
  4. Vasileios

    Rolf Magnus Guest

    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.
     
    Rolf Magnus, Nov 4, 2003
    #4
  5. Vasileios

    Rolf Magnus Guest

    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.
     
    Rolf Magnus, Nov 4, 2003
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gil
    Replies:
    0
    Views:
    460
  2. Per Johansson
    Replies:
    3
    Views:
    1,325
    Mike Wahler
    Nov 7, 2004
  3. xxx
    Replies:
    7
    Views:
    858
  4. Replies:
    4
    Views:
    699
    Pete Becker
    Sep 3, 2006
  5. eric
    Replies:
    3
    Views:
    1,315
    Michael DOUBEZ
    Jul 12, 2011
Loading...

Share This Page