By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,412 Members | 2,843 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,412 IT Pros & Developers. It's quick & easy.

error: expected constructor, destructor, or type conversion before '<' token

P: n/a
hi, i have used the queue library file and try to use the template as

template <class QueueItem>
queue <QueueItem>::~queue() // line 25
{

}

template <class QueueItem>
void queue<QueueItem>::push(const QueueItem& entry) // line 42
{

}

error: expected constructor, destructor, or type conversion before '<'
token
queue.template:25: error: expected `;' before '<' token

queue.template:42: error: expected init-declarator before '<' token
queue.template:42: error: expected `;' before '<' token
can u help out to slove this problem

Oct 28 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
am******@gmail.com wrote:
hi, i have used the queue library file and try to use the template as
Which queue library? Looks like you are missing the declaration of the
template queue.

--
Ian Collins.
Oct 28 '07 #2

P: n/a
On 2007-10-28 19:44, am******@gmail.com wrote:
hi, i have used the queue library file and try to use the template as
What do you mean with "used the queue library file"? Do you mean that
you have included <queueu>? If that is the case then you should not try
to define any of its methods. If not then you have to be more specific
about your problem. Try posting the *minimal* amount of code that
displays the problem.

--
Erik Wikström
Oct 28 '07 #3

P: n/a
am******@gmail.com wrote:
hi, i have used the queue library file and try to use the template as

template <class QueueItem>
queue <QueueItem>::~queue() // line 25
{

}

template <class QueueItem>
void queue<QueueItem>::push(const QueueItem& entry) // line 42
{

}

error: expected constructor, destructor, or type conversion before '<'
token
queue.template:25: error: expected `;' before '<' token

queue.template:42: error: expected init-declarator before '<' token
queue.template:42: error: expected `;' before '<' token
can u help out to slove this problem
Yes, we think we can. Post the _complete_ code.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Oct 28 '07 #4

P: n/a
am******@gmail.com wrote:
hi, i have used the queue library file and try to use the template as

template <class QueueItem>
queue <QueueItem>::~queue() // line 25
{

}

template <class QueueItem>
void queue<QueueItem>::push(const QueueItem& entry) // line 42
{

}

error: expected constructor, destructor, or type conversion before '<'
token
queue.template:25: error: expected `;' before '<' token

queue.template:42: error: expected init-declarator before '<' token
queue.template:42: error: expected `;' before '<' token
can u help out to slove this problem
a) First, please hit the FAQ on how to post code that has problems.

b) Without a reasonable amount of context, it is very hard to help. In
particular, keep in mind that the compiler reports code at the moment of
detection. That can be far beyond the actual position of the error.

c) Just a wild guess: could it be that you have a (class) declaration before
line 24 that misses a semicolon at the end?
Best

Kai-Uwe Bux
Oct 28 '07 #5

P: n/a
On Oct 28, 4:05 pm, Kai-Uwe Bux <jkherci...@gmx.netwrote:
amitm...@gmail.com wrote:
hi, i have used the queue library file and try to use the template as
template <class QueueItem>
queue <QueueItem>::~queue() // line 25
{
}
template <class QueueItem>
void queue<QueueItem>::push(const QueueItem& entry) // line 42
{
}
error: expected constructor, destructor, or type conversion before '<'
token
queue.template:25: error: expected `;' before '<' token
queue.template:42: error: expected init-declarator before '<' token
queue.template:42: error: expected `;' before '<' token
can u help out to slove this problem

a) First, please hit the FAQ on how to post code that has problems.

b) Without a reasonable amount of context, it is very hard to help. In
particular, keep in mind that the compiler reports code at the moment of
detection. That can be far beyond the actual position of the error.

c) Just a wild guess: could it be that you have a (class) declaration before
line 24 that misses a semicolon at the end?

Best

Kai-Uwe Bux
Try to write template class <instead...

Nov 5 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.