error in template

Discussion in 'C++' started by antani, Feb 19, 2007.

  1. antani

    antani Guest

    Hi,
    Why I get a error ?Please help me.


    template <typename InterceptType>
    class InterceptSet
    {
    public:

    typedef vector< InterceptType >::iterator iterator;
    typedef vector< InterceptType >::const_iterator const_iterator;
    ......

    };

    error C2144: syntax error : 'std::iterator' should be preceded by ';'
     
    antani, Feb 19, 2007
    #1
    1. Advertising

  2. On 2007-02-19 18:09, antani wrote:
    > Hi,
    > Why I get a error ?Please help me.
    >
    >
    > template <typename InterceptType>
    > class InterceptSet
    > {
    > public:
    >
    > typedef vector< InterceptType >::iterator iterator;
    > typedef vector< InterceptType >::const_iterator const_iterator;
    > .....
    >
    > };
    >
    > error C2144: syntax error : 'std::iterator' should be preceded by ';'


    I think you should squeez in a typename after the typedef but before the
    vector, like typedef typename vector<...

    --
    Erik Wikström
     
    =?ISO-8859-1?Q?Erik_Wikstr=F6m?=, Feb 19, 2007
    #2
    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. Chris Theis
    Replies:
    2
    Views:
    503
    Chris Theis
    Jul 24, 2003
  2. tom_usenet
    Replies:
    0
    Views:
    567
    tom_usenet
    Jul 24, 2003
  3. Replies:
    1
    Views:
    2,150
    Gianni Mariani
    Jun 8, 2007
  4. Peng Yu
    Replies:
    3
    Views:
    808
    Thomas J. Gritzan
    Oct 26, 2008
  5. nguillot
    Replies:
    5
    Views:
    561
Loading...

Share This Page