Compiler Error with Templates

H

hyderabadblues

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;
}
 
S

Stuart Redmann

hyderabadblues said:
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
 
M

Markus Moll

Hi
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
 

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,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top