error in template

A

antani

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 ';'
 
?

=?ISO-8859-1?Q?Erik_Wikstr=F6m?=

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

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

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,165
Latest member
JavierBrak
Top