Compiler Error with Templates

Discussion in 'C++' started by hyderabadblues, Mar 7, 2007.

  1. 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;
    }
     
    hyderabadblues, Mar 7, 2007
    #1
    1. Advertising

  2. 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
     
    Stuart Redmann, Mar 7, 2007
    #2
    1. Advertising

  3. On Mar 7, 2:52 pm, Stuart Redmann <> wrote:
    > 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
     
    hyderabadblues, Mar 7, 2007
    #3
  4. hyderabadblues

    Markus Moll Guest

    Hi

    hyderabadblues wrote:
    > On Mar 7, 2:52 pm, Stuart Redmann <> wrote:
    >> 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
     
    Markus Moll, Mar 7, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Yan
    Replies:
    0
    Views:
    1,154
  2. Ram
    Replies:
    0
    Views:
    2,878
  3. JKop
    Replies:
    3
    Views:
    492
  4. Generic Usenet Account
    Replies:
    3
    Views:
    840
    Generic Usenet Account
    Jul 14, 2005
  5. recover
    Replies:
    2
    Views:
    831
    recover
    Jul 25, 2006
Loading...

Share This Page