| 1 |
#ifndef USE_RANGES_FAKE_STD_H |
| 2 |
#define USE_RANGES_FAKE_STD_H |
| 3 |
|
| 4 |
namespace std { |
| 5 |
|
| 6 |
template <typename T> class vector { |
| 7 |
public: |
| 8 |
using iterator = T *; |
| 9 |
using const_iterator = const T *; |
| 10 |
using reverse_iterator = T *; |
| 11 |
using reverse_const_iterator = const T *; |
| 12 |
|
| 13 |
constexpr const_iterator begin() const; |
| 14 |
constexpr const_iterator end() const; |
| 15 |
constexpr const_iterator cbegin() const; |
| 16 |
constexpr const_iterator cend() const; |
| 17 |
constexpr iterator begin(); |
| 18 |
constexpr iterator end(); |
| 19 |
constexpr reverse_const_iterator rbegin() const; |
| 20 |
constexpr reverse_const_iterator rend() const; |
| 21 |
constexpr reverse_const_iterator crbegin() const; |
| 22 |
constexpr reverse_const_iterator crend() const; |
| 23 |
constexpr reverse_iterator rbegin(); |
| 24 |
constexpr reverse_iterator rend(); |
| 25 |
}; |
| 26 |
|
| 27 |
template <typename Container> constexpr auto begin(const Container &Cont) { |
| 28 |
return Cont.begin(); |
| 29 |
} |
| 30 |
|
| 31 |
template <typename Container> constexpr auto begin(Container &Cont) { |
| 32 |
return Cont.begin(); |
| 33 |
} |
| 34 |
|
| 35 |
template <typename Container> constexpr auto end(const Container &Cont) { |
| 36 |
return Cont.end(); |
| 37 |
} |
| 38 |
|
| 39 |
template <typename Container> constexpr auto end(Container &Cont) { |
| 40 |
return Cont.end(); |
| 41 |
} |
| 42 |
|
| 43 |
template <typename Container> constexpr auto cbegin(const Container &Cont) { |
| 44 |
return Cont.cbegin(); |
| 45 |
} |
| 46 |
|
| 47 |
template <typename Container> constexpr auto cend(const Container &Cont) { |
| 48 |
return Cont.cend(); |
| 49 |
} |
| 50 |
|
| 51 |
template <typename Container> constexpr auto rbegin(const Container &Cont) { |
| 52 |
return Cont.rbegin(); |
| 53 |
} |
| 54 |
|
| 55 |
template <typename Container> constexpr auto rbegin(Container &Cont) { |
| 56 |
return Cont.rbegin(); |
| 57 |
} |
| 58 |
|
| 59 |
template <typename Container> constexpr auto rend(const Container &Cont) { |
| 60 |
return Cont.rend(); |
| 61 |
} |
| 62 |
|
| 63 |
template <typename Container> constexpr auto rend(Container &Cont) { |
| 64 |
return Cont.rend(); |
| 65 |
} |
| 66 |
|
| 67 |
template <typename Container> constexpr auto crbegin(const Container &Cont) { |
| 68 |
return Cont.crbegin(); |
| 69 |
} |
| 70 |
|
| 71 |
template <typename Container> constexpr auto crend(const Container &Cont) { |
| 72 |
return Cont.crend(); |
| 73 |
} |
| 74 |
// Find |
| 75 |
template <class InputIt, class T> |
| 76 |
InputIt find(InputIt first, InputIt last, const T &value); |
| 77 |
|
| 78 |
// Reverse |
| 79 |
template <typename Iter> void reverse(Iter begin, Iter end); |
| 80 |
|
| 81 |
// Includes |
| 82 |
template <class InputIt1, class InputIt2> |
| 83 |
bool includes(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2); |
| 84 |
|
| 85 |
inline namespace _V1 { |
| 86 |
// IsPermutation |
| 87 |
template <class ForwardIt1, class ForwardIt2> |
| 88 |
bool is_permutation(ForwardIt1 first1, ForwardIt1 last1, ForwardIt2 first2); |
| 89 |
template <class ForwardIt1, class ForwardIt2> |
| 90 |
bool is_permutation(ForwardIt1 first1, ForwardIt1 last1, ForwardIt2 first2, |
| 91 |
ForwardIt2 last2); |
| 92 |
|
| 93 |
// Equal |
| 94 |
template <class InputIt1, class InputIt2> |
| 95 |
bool equal(InputIt1 first1, InputIt1 last1, InputIt2 first2); |
| 96 |
|
| 97 |
template <class InputIt1, class InputIt2> |
| 98 |
bool equal(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2); |
| 99 |
|
| 100 |
template <class InputIt1, class InputIt2, class BinaryPred> |
| 101 |
bool equal(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, |
| 102 |
BinaryPred p) { |
| 103 |
// Need a definition to suppress undefined_internal_type when invoked with |
| 104 |
// lambda |
| 105 |
return true; |
| 106 |
} |
| 107 |
|
| 108 |
template <class ForwardIt, class T> |
| 109 |
void iota(ForwardIt first, ForwardIt last, T value); |
| 110 |
|
| 111 |
template <class ForwardIt> |
| 112 |
ForwardIt rotate(ForwardIt first, ForwardIt middle, ForwardIt last); |
| 113 |
} // namespace _V1 |
| 114 |
|
| 115 |
} // namespace std |
| 116 |
|
| 117 |
#endif // USE_RANGES_FAKE_STD_H |