tfel
Loading...
Searching...
No Matches
tfel::fsalgo::swap_ranges< N > Class Template Reference

swap_ranges swaps each of the elements in the range [first1, first1+N) with the corresponding element in the range [first2, first2 + N). That is, for each integer n such that 0 <= i < N, it swaps *(first1 + i) and *(first2 + i). The return value is first2 + N. More...

#include </home/runner/work/tfel/tfel/include/TFEL/FSAlgorithm/swap_ranges.hxx>

Static Public Member Functions

template<typename ForwardIterator1, typename ForwardIterator2>
static TFEL_FSALGORITHM_INLINE ForwardIterator2 exe (ForwardIterator1 p, ForwardIterator2 q)

Detailed Description

template<unsigned int N>
class tfel::fsalgo::swap_ranges< N >

swap_ranges swaps each of the elements in the range [first1, first1+N) with the corresponding element in the range [first2, first2 + N). That is, for each integer n such that 0 <= i < N, it swaps *(first1 + i) and *(first2 + i). The return value is first2 + N.

Template Parameters
Nsize of the ranges to be swapped.

This documentation is mostly inspired from: http://www.sgi.com/tech/stl/swap_ranges.html

Author
Thomas Helfer
Date
30/06/2006

Member Function Documentation

◆ exe()

template<unsigned int N>
template<typename ForwardIterator1, typename ForwardIterator2>
TFEL_FSALGORITHM_INLINE ForwardIterator2 tfel::fsalgo::swap_ranges< N >::exe ( ForwardIterator1 p,
ForwardIterator2 q )
inlinestatic
Template Parameters
ForwardIterator1iterator to the first range
ForwardIterator2iterator to the second range
Parameters
[in]piterator to the first element of the first range
[in]qiterator to the first element of the second range
Returns
q + N
Precondition
  • ForwardIterator1 and ForwardIterator2 must both be models of Forward Iterator.
  • The value types of ForwardIterator1 and ForwardIterator2 must be convertible to each other.
Author
Thomas Helfer
Date
30/06/2006

The documentation for this class was generated from the following file: