Skip to content

Commit a676687

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 8184005 + 6e7624c commit a676687

Some content is hidden

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

72 files changed

+2489
-590
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,4 +249,4 @@ source:
249249
https://en.cppreference.com/w/ ; \
250250
popd > /dev/null
251251

252-
./export.py --url=http://en.cppreference.com/mwiki reference/cppreference-export-ns0,4,8,10.xml 0 4 8 10
252+
./export.py --url=https://en.cppreference.com/mwiki reference/cppreference-export-ns0,4,8,10.xml 0 4 8 10

headers/README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,52 @@
11

22
Information
33
-----------
4-
4+
55
This directory contains dummy C++ standard library that contains only the
66
declarations of the C++ standard library interface, to be used as an aid in
77
code completion.
88

9-
Real standard library implementations often use complex C++ techniques in order
10-
to provide full compliance and perform optimizations. This leads to code
11-
completion implementations being unable to resolve typedef result and function
12-
return types, and thus being unable to provide code completion of class members
13-
when given instance variable. This issue becomes more and more important with
9+
Real standard library implementations often use complex C++ techniques in order
10+
to provide full compliance and perform optimizations. This leads to code
11+
completion implementations being unable to resolve typedef result and function
12+
return types, and thus being unable to provide code completion of class members
13+
when given instance variable. This issue becomes more and more important with
1414
widespread use of C++ 'auto' type specifier, because code completion of members
1515
of such variables depend on function return types being correctly resolved.
1616

1717
This dummy library performs various steps to simplify the exposed interface, to
1818
make code completion more useful. In addition to that, descriptive parameter
1919
names are exposed instead of uglified identifiers used in real standard library
20-
implementations. The parameter names correspond to those provided for
20+
implementations. The parameter names correspond to those provided for
2121
respective functions in the cppreference.com C++ reference.
2222

23+
To simplify, noexcept specifiers are omitted from declarations.
24+
2325
Configuration
2426
-------------
2527

26-
The exposed interface depends on the values of the following preprocessor
28+
The exposed interface depends on the values of the following preprocessor
2729
macros:
2830

2931
- CPPREFERENCE_STDVER: defines the standard version of the interface. Possible
3032
values are 1998, 2003, 2011, 2014, 2017 which correspond to the respective
3133
C++ standards.
32-
33-
- CPPREFERENCE_SIMPLIFY_TYPEDEFS: non-zero value results in simplified
34-
typedefs being exposed. Usage of various traits is greatly reduced; the
35-
typedefs refer to types that would be resolved in most common cases.
34+
35+
- CPPREFERENCE_SIMPLIFY_TYPEDEFS: non-zero value results in simplified
36+
typedefs being exposed. Usage of various traits is greatly reduced; the
37+
typedefs refer to types that would be resolved in most common cases.
3638
Enabling this is recommended.
3739

3840
Usage
3941
-----
4042

41-
The primary target for this dummy C++ standard library is the Qt Creator IDE,
43+
The primary target for this dummy C++ standard library is the Qt Creator IDE,
4244
though the code might be useful in other IDEs.
4345

44-
For each Qt Creator project, perform the following steps to replace the
46+
For each Qt Creator project, perform the following steps to replace the
4547
C++ library used by code completion:
4648

4749
- Add the path to this directory to the $PROJECT.includes file
4850

4951
- Define CPPREFERENCE_STDVER and/or CPPREFERENCE_SIMPLIFY_TYPEDEFS to correct
50-
values in the $PROJECT.config file.
52+
values in the $PROJECT.config file.

headers/algorithm

Lines changed: 124 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <initializer_list>
2020
#endif
2121
#include <utility> // for std::pair
22+
#include <iterator> // for std::iterator_traits
2223

2324
namespace std {
2425

@@ -38,36 +39,80 @@ UnaryFunction for_each(InputIt first, InputIt last, UnaryFunction f);
3839

3940
template<class InputIt, class T >
4041
typename iterator_traits<InputIt>::difference_type
41-
count(InputIt first, InputIt last, const T& value);
42+
count(InputIt first, InputIt last, const T& value);
4243

4344
template<class InputIt, class UnaryPredicate >
4445
typename 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
4749
template<class InputIt1, class InputIt2 >
4850
std::pair<InputIt1, InputIt2>
49-
mismatch(InputIt1 first1, InputIt1 last1,
50-
InputIt2 first2);
51+
constexpr mismatch(InputIt1 first1, InputIt1 last1,
52+
InputIt2 first2);
5153

5254
template<class InputIt1, class InputIt2, class BinaryPredicate >
5355
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
5786

5887
#if CPPREFERENCE_STDVER >= 2014
5988
template<class InputIt1, class InputIt2 >
6089
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);
6392

6493
template<class InputIt1, class InputIt2, class BinaryPredicate >
6594
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);
69113
#endif
70114

115+
71116
template<class InputIt1, class InputIt2 >
72117
bool 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+
90158
template<class InputIt, class T >
91159
InputIt find(InputIt first, InputIt last, const T& value);
92160

@@ -555,32 +623,32 @@ template<class ForwardIt, class Compare >
555623
constexpr ForwardIt max_element(ForwardIt first, ForwardIt last, Compare cmp);
556624
#endif
557625

558-
#if CPPREFERENCE_STDVER <2014
626+
#if CPPREFERENCE_STDVER >= 2014
559627
template<class T >
560-
const T& min(const T& a, const T& b);
628+
constexpr const T& min(const T& a, const T& b);
561629

562630
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);
564632
#else
565633
template<class T >
566-
constexpr const T& min(const T& a, const T& b);
634+
const T& min(const T& a, const T& b);
567635

568636
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);
570638
#endif
571639

572-
#if CPPREFERENCE_STDVER >= 2011
640+
#if CPPREFERENCE_STDVER >= 2014
573641
template<class T >
574-
T min(std::initializer_list<T> ilist);
642+
constexpr T min(std::initializer_list<T> ilist);
575643

576644
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
579647
template<class T >
580-
constexpr T min(std::initializer_list<T> ilist);
648+
T min(std::initializer_list<T> ilist);
581649

582650
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);
584652
#endif
585653

586654
#if CPPREFERENCE_STDVER <2017
@@ -597,32 +665,32 @@ template<class ForwardIt, class Compare >
597665
constexpr 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
601669
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);
603671

604672
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);
608675
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);
610677

611678
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);
613680

614-
#elif CPPREFERENCE_STDVER >= 2014
681+
#elif CPPREFERENCE_STDVER >= 2011
615682
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);
617684

618685
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+
621689
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);
623691

624692
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);
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
656732
template<class ForwardIt1, class ForwardIt2 >
657733
bool 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
666752
template<class ForwardIt1, class ForwardIt2 >
667753
bool is_permutation(ForwardIt1 first1, ForwardIt1 last1,
668754
ForwardIt2 first2, ForwardIt2 last2);

0 commit comments

Comments
 (0)