Repository navigation
Expand file tree
/
Copy pathsrc.cpp
More file actions
62 lines (49 loc) · 1.72 KB
/
Copy pathsrc.cpp
File metadata and controls
62 lines (49 loc) · 1.72 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Copyright (c) 2022-present INESC-ID.
// Distributed under the MIT license that can be found in the LICENSE file.
#include <algorithm>
#include <fstream>
#include <iterator>
#include <string>
#include <vector>
template <typename T1> void f1(T1 first, T1 last) {
return std::sort(first, last);
}
template <typename T1, typename T2> T2 f2(T1 first, T1 last, T2 d_first) {
return std::copy(first, last, d_first);
}
template <class T1, class T2> T1 f3(T1 first, T1 last, const T2 &value) {
return std::find(first, last, value);
}
template <typename T1, typename T2>
void f6(T1 first, T1 last, T2 comp) {
return std::stable_sort(first, last, comp);
}
template <typename T1> T1 *f8(T1 *first, T1 *last) {
return std::max_element(first, last);
}
template <typename T1> void f9(T1 &a0, T1 &a1) { return std::swap(a0, a1); }
template <typename T1>
typename std::vector<T1>::iterator f10(typename std::vector<T1>::iterator a0,
typename std::vector<T1>::iterator a1) {
return std::unique(a0, a1);
}
template <typename T1, typename T2>
void f12(typename std::vector<T1>::iterator a0,
typename std::vector<T1>::iterator a1, const T2 &a2) {
return std::fill(a0, a1, a2);
}
std::ostream_iterator<char> f13(std::string::iterator a0,
std::string::iterator a1,
std::ostream_iterator<char> a2) {
return std::copy(a0, a1, a2);
}
template <typename T1, typename T2>
void f14(T1 *first, T1 *last, T2 comp) {
return std::stable_sort(first, last, comp);
}
template <typename T1> const T1 &f16(const T1 &a, const T1 &b) {
return std::min(a, b);
}
template <typename T1> const T1 &f17(const T1 &a, const T1 &b) {
return std::max(a, b);
}