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

Compiler Error with Templates

P: n/a

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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.