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 5 7955 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.
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 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 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
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... This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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...
|
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
|
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:
|
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...
|
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...
| |
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...
|
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...
|
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
|
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;...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| | |