Skip to content

Commit ab48cc3

Browse files
committed
<algorithm>に並列アルゴリズムのオーバーロード宣言を記載
仕様とサンプルコードは追々。for_each_nはまだ
1 parent cb29a48 commit ab48cc3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+900
-121
lines changed

reference/algorithm/adjacent_find.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ namespace std {
2626
adjacent_find(ForwardIterator first,
2727
ForwardIterator last,
2828
BinaryPredicate pred); // (2) C++20
29+
30+
template<class ExecutionPolicy, class ForwardIterator>
31+
ForwardIterator
32+
adjacent_find(ExecutionPolicy&& exec,
33+
ForwardIterator first,
34+
ForwardIterator last); // (3) C++17
35+
36+
template <class ExecutionPolicy, class ForwardIterator, class BinaryPredicate>
37+
ForwardIterator
38+
adjacent_find(ExecutionPolicy&& exec,
39+
ForwardIterator first,
40+
ForwardIterator last,
41+
BinaryPredicate pred); // (4) C++17
2942
}
3043
```
3144

reference/algorithm/all_of.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,18 @@ namespace std {
99
template <class InputIterator, class Predicate>
1010
bool all_of(InputIterator first,
1111
InputIterator last,
12-
Predicate pred); // C++11
12+
Predicate pred); // (1) C++11
1313

1414
template <class InputIterator, class Predicate>
1515
constexpr bool all_of(InputIterator first,
1616
InputIterator last,
17-
Predicate pred); // C++20
17+
Predicate pred); // (1) C++20
18+
19+
template <class ExecutionPolicy, class ForwardIterator, class Predicate>
20+
bool all_of(ExecutionPolicy&& exec,
21+
ForwardIterator first,
22+
ForwardIterator last,
23+
Predicate pred); // (2) C++17
1824
}
1925
```
2026

reference/algorithm/any_of.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,18 @@ namespace std {
99
template <class InputIterator, class Predicate>
1010
bool any_of(InputIterator first,
1111
InputIterator last,
12-
Predicate pred); // C++11
12+
Predicate pred); // (1) C++11
1313

1414
template <class InputIterator, class Predicate>
1515
constexpr bool any_of(InputIterator first,
1616
InputIterator last,
17-
Predicate pred); // C++20
17+
Predicate pred); // (1) C++20
18+
19+
template <class ExecutionPolicy, class ForwardIterator, class Predicate>
20+
bool any_of(ExecutionPolicy&& exec,
21+
ForwardIterator first,
22+
ForwardIterator last,
23+
Predicate pred); // (2) C++17
1824
}
1925
```
2026

reference/algorithm/copy.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,20 @@ namespace std {
99
OutputIterator
1010
copy(InputIterator first,
1111
InputIterator last,
12-
OutputIterator result); // C++03
12+
OutputIterator result); // (1) C++03
1313

1414
template <class InputIterator, class OutputIterator>
1515
constexpr OutputIterator
1616
copy(InputIterator first,
1717
InputIterator last,
18-
OutputIterator result); // C++20
18+
OutputIterator result); // (1) C++20
19+
20+
template <class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
21+
ForwardIterator2
22+
copy(ExecutionPolicy&& exec,
23+
ForwardIterator1 first,
24+
ForwardIterator1 last,
25+
ForwardIterator2 result); // (2) C++17
1926
}
2027
```
2128

reference/algorithm/copy_if.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,23 @@ namespace std {
1111
copy_if(InputIterator first,
1212
InputIterator last,
1313
OutputIterator result,
14-
Predicate pred); // C++11
14+
Predicate pred); // (1) C++11
1515

1616
template <class InputIterator, class OutputIterator, class Predicate>
1717
constexpr OutputIterator
1818
copy_if(InputIterator first,
1919
InputIterator last,
2020
OutputIterator result,
21-
Predicate pred); // C++20
21+
Predicate pred); // (1) C++20
22+
23+
template <class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
24+
class Predicate>
25+
ForwardIterator2
26+
copy_if(ExecutionPolicy&& exec,
27+
ForwardIterator1 first,
28+
ForwardIterator1 last,
29+
ForwardIterator2 result,
30+
Predicate pred); // (2) C++17
2231
}
2332
```
2433

reference/algorithm/copy_n.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,21 @@ namespace std {
1111
OutputIterator
1212
copy_n(InputIterator first,
1313
Size n,
14-
OutputIterator result); // C++11
14+
OutputIterator result); // (1) C++11
1515

1616
template <class InputIterator, class Size, class OutputIterator>
1717
constexpr OutputIterator
1818
copy_n(InputIterator first,
1919
Size n,
20-
OutputIterator result); // C++20
20+
OutputIterator result); // (1) C++20
21+
22+
template <class ExecutionPolicy, class ForwardIterator1, class Size,
23+
class ForwardIterator2>
24+
ForwardIterator2
25+
copy_n(ExecutionPolicy&& exec,
26+
ForwardIterator1 first,
27+
Size n,
28+
ForwardIterator2 result); // (2) C++17
2129
}
2230
```
2331

reference/algorithm/count.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,22 @@
77
namespace std {
88
template <class InputIterator, class T>
99
typename iterator_traits<InputIterator>::difference_type
10-
count(InputIterator first, InputIterator last, const T& value); // C++03
10+
count(InputIterator first,
11+
InputIterator last,
12+
const T& value); // (1) C++03
1113

1214
template <class InputIterator, class T>
1315
constexpr typename iterator_traits<InputIterator>::difference_type
14-
count(InputIterator first, InputIterator last, const T& value); // C++20
16+
count(InputIterator first,
17+
InputIterator last,
18+
const T& value); // (1) C++20
19+
20+
template<class ExecutionPolicy, class ForwardIterator, class T>
21+
typename iterator_traits<ForwardIterator>::difference_type
22+
count(ExecutionPolicy&& exec,
23+
ForwardIterator first,
24+
ForwardIterator last,
25+
const T& value); // (2) C++17
1526
}
1627
```
1728
* iterator_traits[link /reference/iterator/iterator_traits.md]

reference/algorithm/count_if.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,22 @@
77
namespace std {
88
template <class InputIterator, class Predicate>
99
typename iterator_traits<InputIterator>::difference_type
10-
count_if(InputIterator first, InputIterator last, Predicate pred); // C++03
10+
count_if(InputIterator first,
11+
InputIterator last,
12+
Predicate pred); // (1) C++03
1113

1214
template <class InputIterator, class Predicate>
1315
constexpr typename iterator_traits<InputIterator>::difference_type
14-
count_if(InputIterator first, InputIterator last, Predicate pred); // C++20
16+
count_if(InputIterator first,
17+
InputIterator last,
18+
Predicate pred); // (1) C++20
19+
20+
template<class ExecutionPolicy, class ForwardIterator, class Predicate>
21+
typename iterator_traits<ForwardIterator>::difference_type
22+
count_if(ExecutionPolicy&& exec,
23+
ForwardIterator first,
24+
ForwardIterator last,
25+
Predicate pred); // (2) C++17
1526
}
1627
```
1728
* iterator_traits[link /reference/iterator/iterator_traits.md]

reference/algorithm/equal.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,36 @@ namespace std {
5252
InputIterator2 first2,
5353
InputIterator2 last2,
5454
BinaryPredicate pred); // (4) C++20
55+
56+
template <class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
57+
bool equal(ExecutionPolicy&& exec,
58+
ForwardIterator1 first1,
59+
ForwardIterator1 last1,
60+
ForwardIterator2 first2); // (5) C++17
61+
62+
template <class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
63+
class BinaryPredicate>
64+
bool equal(ExecutionPolicy&& exec,
65+
ForwardIterator1 first1,
66+
ForwardIterator1 last1,
67+
ForwardIterator2 first2,
68+
BinaryPredicate pred); // (6) C++17
69+
70+
template <class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
71+
bool equal(ExecutionPolicy&& exec,
72+
ForwardIterator1 first1,
73+
ForwardIterator1 last1,
74+
ForwardIterator2 first2,
75+
ForwardIterator2 last2); // (7) C++17
76+
77+
template <class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
78+
class BinaryPredicate>
79+
bool equal(ExecutionPolicy&& exec,
80+
ForwardIterator1 first1,
81+
ForwardIterator1 last1,
82+
ForwardIterator2 first2,
83+
ForwardIterator2 last2,
84+
BinaryPredicate pred); // (8) C++17
5585
}
5686
```
5787

reference/algorithm/fill.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,19 @@ namespace std {
88
template <class ForwardIterator, class T>
99
void fill(ForwardIterator first,
1010
ForwardIterator last,
11-
const T& value); // C++03
11+
const T& value); // (1) C++03
1212

1313
template <class ForwardIterator, class T>
1414
constexpr void fill(ForwardIterator first,
1515
ForwardIterator last,
16-
const T& value); // C++20
16+
const T& value); // (1) C++20
17+
18+
template <class ExecutionPolicy, class ForwardIterator,
19+
class T>
20+
void fill(ExecutionPolicy&& exec,
21+
ForwardIterator first,
22+
ForwardIterator last,
23+
const T& value); // (2) C++17
1724
}
1825
```
1926

0 commit comments

Comments
 (0)