blob: 56b71a712827a32a0858f7907394811fed45ab68 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// Part of the BastionOS freestanding C++ standard library.
//
//===----------------------------------------------------------------------===//
#ifndef _LIBBASTION_ALGORITHM
#define _LIBBASTION_ALGORITHM
#include <__config>
#include <__algorithm/minmax.h>
#include <__algorithm/find.h>
#include <__algorithm/copy.h>
#include <__algorithm/fill.h>
#include <__algorithm/comparison.h>
#include <__algorithm/sort.h>
#include <__algorithm/bound.h>
#include <__algorithm/for_each.h>
// Also pull in swap (algorithms often need it).
#include <__utility/swap.h>
_LIBBASTION_BEGIN_NAMESPACE_STD
// swap_ranges
template<class _ForwardIt1, class _ForwardIt2>
constexpr _ForwardIt2 swap_ranges(_ForwardIt1 __first1, _ForwardIt1 __last1, _ForwardIt2 __first2) {
for (; __first1 != __last1; ++__first1, ++__first2)
swap(*__first1, *__first2);
return __first2;
}
// iter_swap
template<class _ForwardIt1, class _ForwardIt2>
constexpr void iter_swap(_ForwardIt1 __a, _ForwardIt2 __b) {
swap(*__a, *__b);
}
_LIBBASTION_END_NAMESPACE_STD
#endif // _LIBBASTION_ALGORITHM
|