473,513 Members | 2,469 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Compiler Error with Templates


Following is a inline function that I am using in my code afetr
compilation I am getting the error
"Error: this declaration can not have multiple "template<a>"
clauses..."
template <class _BidirectionalIter1, class _BidirectionalIter2,
>
inline _BidirectionalIter2 __copy_backward(_BidirectionalIter1
__first,
_BidirectionalIter1
__last,
_BidirectionalIter2
__result
)
{
while (__first != __last)
*--__result = *--__last;
return __result;
}

Mar 7 '07 #1
3 1595
hyderabadblues wrote:
Following is a inline function that I am using in my code afetr
compilation I am getting the error
"Error: this declaration can not have multiple "template<a>"
clauses..."
template <class _BidirectionalIter1, class _BidirectionalIter2,
Looks like a superflous comma to me.
>
inline _BidirectionalIter2 __copy_backward(_BidirectionalIter1
__first,
_BidirectionalIter1
__last,
_BidirectionalIter2
__result
)
{
while (__first != __last)
*--__result = *--__last;
return __result;
}
Regards,
Stuart
Mar 7 '07 #2
On Mar 7, 2:52 pm, Stuart Redmann <DerTop...@web.dewrote:
hyderabadblues wrote:
Following is a inline function that I am using in my code afetr
compilation I am getting the error
"Error: this declaration can not have multiple "template<a>"
clauses..."
template <class _BidirectionalIter1, class _BidirectionalIter2,

Looks like a superflous comma to me.
inline _BidirectionalIter2 __copy_backward(_BidirectionalIter1
__first,
_BidirectionalIter1
__last,
_BidirectionalIter2
__result
)
{
while (__first != __last)
*--__result = *--__last;
return __result;
}

Regards,
Stuart
It was typo........ ;) i have copied and pasted the code

Mar 7 '07 #3
Hi

hyderabadblues wrote:
On Mar 7, 2:52 pm, Stuart Redmann <DerTop...@web.dewrote:
>hyderabadblues wrote:
>>inline _BidirectionalIter2 __copy_backward(_BidirectionalIter1
__first,
_BidirectionalIter1
__last,
_BidirectionalIter2
__result
)
{
while (__first != __last)
*--__result = *--__last;
return __result;
}
Regards,
Stuart

It was typo........ ;) i have copied and pasted the code
Yes, apparently you have done so, and apparently the source was some
standard library implementation. You should be aware that you cannot use
your code in conjunction with any part of the standard library any
more, as you have used reserved names (in fact, every single name in the
above fragment is reserved).

Markus
Mar 7 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2663
by: Matthew Del Buono | last post by:
Don't try to solve the problem. I've found a way -- around or fixing it. I'm just curious as to whether this is Microsoft's problem in their compiler or if there's a standard saying this is to be...
1
1952
by: Generic Usenet Account | last post by:
Don't you often wish that compiler and linker messages for templates were a little less cryptic and misleading? Consider this: I was getting this error message: undefined reference to `vtable...
14
4253
by: Mark Dufour | last post by:
After nine months of hard work, I am proud to introduce my baby to the world: an experimental Python-to-C++ compiler. It can convert many Python programs into optimized C++ code, without any user...
16
2828
by: pj | last post by:
(Was originally, probably wrongly, posted to the vc subgroup.) (This doesn't appear to be a c# problem, but a problem with a bug in the Visual Studio c# compiler, but, any help will be welcome...)...
3
2121
by: Benedikt Weber | last post by:
I found the following compiler error with Microsoft Visual C++ .NET. I use different functions with return types determined by a Traits class. Function g() below works ok, but when I put the two...
4
1940
by: KK | last post by:
Hello all, I have class 'atr' which is based on templates. My idea was to initialize it two scenarios 1. std::string case 2. other data types I have defined the Init for the above different...
55
12747
by: Steve | last post by:
I have to develop several large and complex C++ hardware test programs that should work under DOS, most likely with 32-bit DOS extender. Development workstation OS would be Microsoft XP. Quite some...
7
4324
by: Chameleon | last post by:
This code below compiles fine with VS.2005 but with gcc 3.4.2 not. ------------------ template<class T> static void Wastage1D::clever_erase(vector<T> &v, vector<typename vector<T>::iterator>...
41
18064
by: Miroslaw Makowiecki | last post by:
Where can I download Comeau compiler as a trial version? Thanks in advice.
2
1701
by: tropos | last post by:
I'm trying to use the 'typedef templates' idiom, mentioned in Alexandrescu's work on templates. Here's a Dr Dobbs article from 2002 that says they are a proposed C++ standard:...
0
7162
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...
0
7384
Oralloy
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,...
0
7539
jinu1996
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...
1
5090
isladogs
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...
0
4746
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...
0
3234
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3223
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1597
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.