1919#include <initializer_list>
2020#endif
2121#include <utility> // for std::pair
22+ #include <iterator> // for std::iterator_traits
2223
2324namespace std {
2425
@@ -38,36 +39,80 @@ UnaryFunction for_each(InputIt first, InputIt last, UnaryFunction f);
3839
3940template<class InputIt, class T >
4041typename iterator_traits<InputIt>::difference_type
41- count(InputIt first, InputIt last, const T& value);
42+ count(InputIt first, InputIt last, const T& value);
4243
4344template<class InputIt, class UnaryPredicate >
4445typename iterator_traits<InputIt>::difference_type
45- count_if(InputIt first, InputIt last, UnaryPredicate p);
46+ count_if(InputIt first, InputIt last, UnaryPredicate p);
4647
48+ #if CPPREFERENCE_STDVER >= 2020
4749template<class InputIt1, class InputIt2 >
4850std::pair<InputIt1, InputIt2>
49- mismatch(InputIt1 first1, InputIt1 last1,
50- InputIt2 first2);
51+ constexpr mismatch(InputIt1 first1, InputIt1 last1,
52+ InputIt2 first2);
5153
5254template<class InputIt1, class InputIt2, class BinaryPredicate >
5355std::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
5786
5887#if CPPREFERENCE_STDVER >= 2014
5988template<class InputIt1, class InputIt2 >
6089std::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);
6392
6493template<class InputIt1, class InputIt2, class BinaryPredicate >
6594std::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);
69113#endif
70114
115+
71116template<class InputIt1, class InputIt2 >
72117bool equal(InputIt1 first1, InputIt1 last1,
73118 InputIt2 first2);
@@ -87,6 +132,29 @@ bool equal(InputIt1 first1, InputIt1 last1,
87132 BinaryPredicate p);
88133#endif
89134
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+
90158template<class InputIt, class T >
91159InputIt find(InputIt first, InputIt last, const T& value);
92160
@@ -555,32 +623,32 @@ template<class ForwardIt, class Compare >
555623constexpr ForwardIt max_element(ForwardIt first, ForwardIt last, Compare cmp);
556624#endif
557625
558- #if CPPREFERENCE_STDVER < 2014
626+ #if CPPREFERENCE_STDVER >= 2014
559627template<class T >
560- const T& min(const T& a, const T& b);
628+ constexpr const T& min(const T& a, const T& b);
561629
562630template<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);
564632#else
565633template<class T >
566- constexpr const T& min(const T& a, const T& b);
634+ const T& min(const T& a, const T& b);
567635
568636template<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);
570638#endif
571639
572- #if CPPREFERENCE_STDVER >= 2011
640+ #if CPPREFERENCE_STDVER >= 2014
573641template<class T >
574- T min(std::initializer_list<T> ilist);
642+ constexpr T min(std::initializer_list<T> ilist);
575643
576644template<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
579647template<class T >
580- constexpr T min(std::initializer_list<T> ilist);
648+ T min(std::initializer_list<T> ilist);
581649
582650template<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);
584652#endif
585653
586654#if CPPREFERENCE_STDVER <2017
@@ -597,32 +665,32 @@ template<class ForwardIt, class Compare >
597665constexpr ForwardIt min_element(ForwardIt first, ForwardIt last, Compare cmp);
598666#endif
599667
600- #if CPPREFERENCE_STDVER >= 2011 && CPPREFERENCE_STDVER < 2014
668+ #if CPPREFERENCE_STDVER >= 2014
601669template<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);
603671
604672template<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);
608675template<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);
610677
611678template<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);
613680
614- #elif CPPREFERENCE_STDVER >= 2014
681+ #elif CPPREFERENCE_STDVER >= 2011
615682template<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);
617684
618685template<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+
621689template<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);
623691
624692template<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);
626694#endif
627695
628696#if CPPREFERENCE_STDVER >= 2011 && CPPREFERENCE_STDVER <2017
@@ -652,7 +720,15 @@ bool lexicographical_compare(InputIt1 first1, InputIt1 last1,
652720 InputIt2 first2, InputIt2 last2,
653721 Compare comp);
654722
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
656732template<class ForwardIt1, class ForwardIt2 >
657733bool is_permutation(ForwardIt1 first1, ForwardIt1 last1,
658734 ForwardIt2 first2);
@@ -662,7 +738,17 @@ bool is_permutation(ForwardIt1 first1, ForwardIt1 last1,
662738 ForwardIt2 first2, BinaryPredicate p);
663739#endif
664740
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
666752template<class ForwardIt1, class ForwardIt2 >
667753bool is_permutation(ForwardIt1 first1, ForwardIt1 last1,
668754 ForwardIt2 first2, ForwardIt2 last2);
0 commit comments