472,373 Members | 1,626 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,373 software developers and data experts.

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

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
5 7813
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: sarah | last post by:
I keep getting the following error: g++ SortedList.cpp SortedList.cpp:260: error: expected constructor, destructor, or type conversion before '*' token SortedList.cpp:260: error: expected `,' or...
5
by: cranium.2003 | last post by:
hi, Here is my code #include <iostream.h> int main() { cout <<"HI"; return 0; } and using following command to compile a C++ program g++ ex1.cpp -o ex1
2
by: Suneeel | last post by:
Hi all, I'm new at templates. I've written this code and am compiling it with gcc 4.1.0 on RedHat Linux 9. /////////temptest.h////////////// template <class T> class tempclass { public:
9
by: Trent | last post by:
Here is the error while using Visual Studio 2005 Error 1 error LNK2019: unresolved external symbol "void __cdecl print(int,int,int,int,int,int,int,int)" (?print@@YAXHHHHHHHH@Z) referenced in...
2
by: brasewel | last post by:
Hi guys, I'm getting an error i cannot figure. Here is my code Header file ------------------------------------------------------------------------------------------- #ifndef Clock_H #define...
1
by: BSand0764 | last post by:
I'm getting an error that I can't seem to resolve. When I compile the Functor related logic in a test program, the files compile and execute properly (see Listing #1). However, when I...
13
by: edyam | last post by:
I'm trying to template a pointer-based list class and several functions (the ones in which I try to return a pointer) are producing error messages. The class: template <typename T> class List...
2
by: parvtb | last post by:
I have the following code: #include <list> using namespace std; template <typename T> list<T>::iterator doStuff( list<T>::iterator myIter ) //--error here
3
by: Hill | last post by:
This is an simple map, just an exercise. Who can help me fix this compile issue?Thanks in advance. #include <string> #include <vector> #include <iostream> using std::vector; using std::string;...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.