19
19
#include <initializer_list>
20
20
#endif
21
21
#include <utility> // for std::pair
22
+ #include <iterator> // for std::iterator_traits
22
23
23
24
namespace std {
24
25
@@ -38,36 +39,80 @@ UnaryFunction for_each(InputIt first, InputIt last, UnaryFunction f);
38
39
39
40
template<class InputIt, class T >
40
41
typename iterator_traits<InputIt>::difference_type
41
- count(InputIt first, InputIt last, const T& value);
42
+ count(InputIt first, InputIt last, const T& value);
42
43
43
44
template<class InputIt, class UnaryPredicate >
44
45
typename iterator_traits<InputIt>::difference_type
45
- count_if(InputIt first, InputIt last, UnaryPredicate p);
46
+ count_if(InputIt first, InputIt last, UnaryPredicate p);
46
47
48
+ #if CPPREFERENCE_STDVER >= 2020
47
49
template<class InputIt1, class InputIt2 >
48
50
std::pair<InputIt1, InputIt2>
49
- mismatch(InputIt1 first1, InputIt1 last1,
50
- InputIt2 first2);
51
+ constexpr mismatch(InputIt1 first1, InputIt1 last1,
52
+ InputIt2 first2);
51
53
52
54
template<class InputIt1, class InputIt2, class BinaryPredicate >
53
55
std::pair<InputIt1, InputIt2>
54
- mismatch(InputIt1 first1, InputIt1 last1,
55
- InputIt2 first2,
56
- BinaryPredicate p);
56
+ constexpr mismatch(InputIt1 first1, InputIt1 last1,
57
+ InputIt2 first2,
58
+ BinaryPredicate p);
59
+ #else
60
+ template<class InputIt1, class InputIt2 >
61
+ std::pair<InputIt1, InputIt2>
62
+ mismatch(InputIt1 first1, InputIt1 last1,
63
+ InputIt2 first2);
64
+
65
+ template<class InputIt1, class InputIt2, class BinaryPredicate >
66
+ std::pair<InputIt1, InputIt2>
67
+ mismatch(InputIt1 first1, InputIt1 last1,
68
+ InputIt2 first2,
69
+ BinaryPredicate p);
70
+ #endif
71
+
72
+ #if CPPREFERENCE_STDVER >= 2017
73
+ template<class ExecutionPolicy, class InputIt1, class InputIt2 >
74
+ std::pair<InputIt1, InputIt2>
75
+ mismatch(ExecutionPolicy&& policy,
76
+ InputIt1 first1, InputIt1 last1,
77
+ InputIt2 first2);
78
+
79
+ template<class ExecutionPolicy, class InputIt1, class InputIt2, class BinaryPredicate >
80
+ std::pair<InputIt1, InputIt2>
81
+ mismatch(ExecutionPolicy&& policy,
82
+ InputIt1 first1, InputIt1 last1,
83
+ InputIt2 first2,
84
+ BinaryPredicate p);
85
+ #endif
57
86
58
87
#if CPPREFERENCE_STDVER >= 2014
59
88
template<class InputIt1, class InputIt2 >
60
89
std::pair<InputIt1, InputIt2>
61
- mismatch(InputIt1 first1, InputIt1 last1,
62
- InputIt2 first2, InputIt2 last2);
90
+ mismatch(InputIt1 first1, InputIt1 last1,
91
+ InputIt2 first2, InputIt2 last2);
63
92
64
93
template<class InputIt1, class InputIt2, class BinaryPredicate >
65
94
std::pair<InputIt1, InputIt2>
66
- mismatch(InputIt1 first1, InputIt1 last1,
67
- InputIt2 first2, InputIt2 last2,
68
- BinaryPredicate p);
95
+ mismatch(InputIt1 first1, InputIt1 last1,
96
+ InputIt2 first2, InputIt2 last2,
97
+ BinaryPredicate p);
98
+ #endif
99
+
100
+ #if CPPREFERENCE_STDVER >= 2017
101
+ template<class ExecutionPolicy, class InputIt1, class InputIt2 >
102
+ std::pair<InputIt1, InputIt2>
103
+ mismatch(ExecutionPolicy&& policy,
104
+ InputIt1 first1, InputIt1 last1,
105
+ InputIt2 first2, InputIt2 last2);
106
+
107
+ template<class ExecutionPolicy, class InputIt1, class InputIt2, class BinaryPredicate >
108
+ std::pair<InputIt1, InputIt2>
109
+ mismatch(ExecutionPolicy&& policy,
110
+ InputIt1 first1, InputIt1 last1,
111
+ InputIt2 first2, InputIt2 last2,
112
+ BinaryPredicate p);
69
113
#endif
70
114
115
+
71
116
template<class InputIt1, class InputIt2 >
72
117
bool equal(InputIt1 first1, InputIt1 last1,
73
118
InputIt2 first2);
@@ -87,6 +132,29 @@ bool equal(InputIt1 first1, InputIt1 last1,
87
132
BinaryPredicate p);
88
133
#endif
89
134
135
+ #if CPPREFERENCE_STDVER >= 2017
136
+ template<class ExecutionPolicy, class InputIt1, class InputIt2 >
137
+ bool equal(ExecutionPolicy&& policy,
138
+ InputIt1 first1, InputIt1 last1,
139
+ InputIt2 first2);
140
+
141
+ template<class ExecutionPolicy, class InputIt1, class InputIt2, class BinaryPredicate >
142
+ bool equal(ExecutionPolicy&& policy,
143
+ InputIt1 first1, InputIt1 last1,
144
+ InputIt2 first2, BinaryPredicate p);
145
+
146
+ template<class ExecutionPolicy, class InputIt1, class InputIt2 >
147
+ bool equal(ExecutionPolicy&& policy,
148
+ InputIt1 first1, InputIt1 last1,
149
+ InputIt2 first2, InputIt2 last2);
150
+
151
+ template<class ExecutionPolicy, class InputIt1, class InputIt2, class BinaryPredicate >
152
+ bool equal(ExecutionPolicy&& policy,
153
+ InputIt1 first1, InputIt1 last1,
154
+ InputIt2 first2, InputIt2 last2,
155
+ BinaryPredicate p);
156
+ #endif
157
+
90
158
template<class InputIt, class T >
91
159
InputIt find(InputIt first, InputIt last, const T& value);
92
160
@@ -555,32 +623,32 @@ template<class ForwardIt, class Compare >
555
623
constexpr ForwardIt max_element(ForwardIt first, ForwardIt last, Compare cmp);
556
624
#endif
557
625
558
- #if CPPREFERENCE_STDVER < 2014
626
+ #if CPPREFERENCE_STDVER >= 2014
559
627
template<class T >
560
- const T& min(const T& a, const T& b);
628
+ constexpr const T& min(const T& a, const T& b);
561
629
562
630
template<class T, class Compare >
563
- const T& min(const T& a, const T& b, Compare comp);
631
+ constexpr const T& min(const T& a, const T& b, Compare comp);
564
632
#else
565
633
template<class T >
566
- constexpr const T& min(const T& a, const T& b);
634
+ const T& min(const T& a, const T& b);
567
635
568
636
template<class T, class Compare >
569
- constexpr const T& min(const T& a, const T& b, Compare comp);
637
+ const T& min(const T& a, const T& b, Compare comp);
570
638
#endif
571
639
572
- #if CPPREFERENCE_STDVER >= 2011
640
+ #if CPPREFERENCE_STDVER >= 2014
573
641
template<class T >
574
- T min(std::initializer_list<T> ilist);
642
+ constexpr T min(std::initializer_list<T> ilist);
575
643
576
644
template<class T, class Compare >
577
- T min(std::initializer_list<T> ilist, Compare comp);
578
- #elif CPPREFERENCE_STDVER >= 2014
645
+ constexpr T min(std::initializer_list<T> ilist, Compare comp);
646
+ #elif CPPREFERENCE_STDVER >= 2011
579
647
template<class T >
580
- constexpr T min(std::initializer_list<T> ilist);
648
+ T min(std::initializer_list<T> ilist);
581
649
582
650
template<class T, class Compare >
583
- constexpr T min(std::initializer_list<T> ilist, Compare comp);
651
+ T min(std::initializer_list<T> ilist, Compare comp);
584
652
#endif
585
653
586
654
#if CPPREFERENCE_STDVER <2017
@@ -597,32 +665,32 @@ template<class ForwardIt, class Compare >
597
665
constexpr ForwardIt min_element(ForwardIt first, ForwardIt last, Compare cmp);
598
666
#endif
599
667
600
- #if CPPREFERENCE_STDVER >= 2011 && CPPREFERENCE_STDVER < 2014
668
+ #if CPPREFERENCE_STDVER >= 2014
601
669
template<class T >
602
- std::pair<const T&, const T&> minmax(const T& a, const T& b);
670
+ constexpr std::pair<const T&, const T&> minmax(const T& a, const T& b);
603
671
604
672
template<class T, class Compare >
605
- std::pair<const T&, const T&> minmax(const T& a, const T& b,
606
- Compare comp);
607
-
673
+ constexpr std::pair<const T&, const T&> minmax(const T& a, const T& b,
674
+ Compare comp);
608
675
template<class T >
609
- std::pair<T, T> minmax(std::initializer_list<T> ilist);
676
+ constexpr std::pair<T, T> minmax(std::initializer_list<T> ilist);
610
677
611
678
template<class T, class Compare >
612
- std::pair<T, T> minmax(std::initializer_list<T> ilist, Compare comp);
679
+ constexpr std::pair<T, T> minmax(std::initializer_list<T> ilist, Compare comp);
613
680
614
- #elif CPPREFERENCE_STDVER >= 2014
681
+ #elif CPPREFERENCE_STDVER >= 2011
615
682
template<class T >
616
- constexpr std::pair<const T&, const T&> minmax(const T& a, const T& b);
683
+ std::pair<const T&, const T&> minmax(const T& a, const T& b);
617
684
618
685
template<class T, class Compare >
619
- constexpr std::pair<const T&, const T&> minmax(const T& a, const T& b,
620
- Compare comp);
686
+ std::pair<const T&, const T&> minmax(const T& a, const T& b,
687
+ Compare comp);
688
+
621
689
template<class T >
622
- constexpr std::pair<T, T> minmax(std::initializer_list<T> ilist);
690
+ std::pair<T, T> minmax(std::initializer_list<T> ilist);
623
691
624
692
template<class T, class Compare >
625
- constexpr std::pair<T, T> minmax(std::initializer_list<T> ilist, Compare comp);
693
+ std::pair<T, T> minmax(std::initializer_list<T> ilist, Compare comp);
626
694
#endif
627
695
628
696
#if CPPREFERENCE_STDVER >= 2011 && CPPREFERENCE_STDVER <2017
@@ -652,7 +720,15 @@ bool lexicographical_compare(InputIt1 first1, InputIt1 last1,
652
720
InputIt2 first2, InputIt2 last2,
653
721
Compare comp);
654
722
655
- #if CPPREFERENCE_STDVER >= 2011
723
+ #if CPPREFERENCE_STDVER >= 2020
724
+ template<class ForwardIt1, class ForwardIt2 >
725
+ constexpr bool is_permutation(ForwardIt1 first1, ForwardIt1 last1,
726
+ ForwardIt2 first2);
727
+
728
+ template<class ForwardIt1, class ForwardIt2, class BinaryPredicate >
729
+ constexpr bool is_permutation(ForwardIt1 first1, ForwardIt1 last1,
730
+ ForwardIt2 first2, BinaryPredicate p);
731
+ #elif CPPREFERENCE_STDVER >= 2011
656
732
template<class ForwardIt1, class ForwardIt2 >
657
733
bool is_permutation(ForwardIt1 first1, ForwardIt1 last1,
658
734
ForwardIt2 first2);
@@ -662,7 +738,17 @@ bool is_permutation(ForwardIt1 first1, ForwardIt1 last1,
662
738
ForwardIt2 first2, BinaryPredicate p);
663
739
#endif
664
740
665
- #if CPPREFERENCE_STDVER >= 2011
741
+ #if CPPREFERENCE_STDVER >= 2020
742
+ template<class ForwardIt1, class ForwardIt2 >
743
+ constexpr bool is_permutation(ForwardIt1 first1, ForwardIt1 last1,
744
+ ForwardIt2 first2, ForwardIt2 last2);
745
+
746
+ template<class ForwardIt1, class ForwardIt2, class BinaryPredicate >
747
+ constexpr bool is_permutation(ForwardIt1 first1, ForwardIt1 last1,
748
+ ForwardIt2 first2, ForwardIt2 last2,
749
+ BinaryPredicate p);
750
+
751
+ #elif CPPREFERENCE_STDVER >= 2011
666
752
template<class ForwardIt1, class ForwardIt2 >
667
753
bool is_permutation(ForwardIt1 first1, ForwardIt1 last1,
668
754
ForwardIt2 first2, ForwardIt2 last2);
0 commit comments