@@ -213,7 +213,8 @@ public:
213
213
template <class Predicate> // deprecated in C++17
214
214
binary_negate<Predicate> not2(const Predicate& pred);
215
215
216
- template <class F> unspecified not_fn(F&& f); // C++17
216
+ template <class F>
217
+ constexpr unspecified not_fn(F&& f); // C++17, constexpr in C++20
217
218
218
219
template<class T> struct is_bind_expression;
219
220
template<class T> struct is_placeholder;
@@ -226,11 +227,12 @@ template <class T> inline constexpr int is_placeholder_v
226
227
227
228
228
229
template<class Fn, class... BoundArgs>
229
- unspecified bind(Fn&&, BoundArgs&&...);
230
+ constexpr unspecified bind(Fn&&, BoundArgs&&...); // constexpr in C++20
230
231
template<class R, class Fn, class... BoundArgs>
231
- unspecified bind(Fn&&, BoundArgs&&...);
232
+ constexpr unspecified bind(Fn&&, BoundArgs&&...); // constexpr in C++20
232
233
233
234
template<class F, class... Args>
235
+ constexpr // constexpr in C++20
234
236
invoke_result_t<F, Args...> invoke(F&& f, Args&&... args) // C++17
235
237
noexcept(is_nothrow_invocable_v<F, Args...>);
236
238
@@ -376,7 +378,8 @@ public:
376
378
template <class S, class T> const_mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)() const); // deprecated in C++11, removed in C++17
377
379
template <class S, class T, class A> const_mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A) const); // deprecated in C++11, removed in C++17
378
380
379
- template<class R, class T> unspecified mem_fn(R T::*);
381
+ template<class R, class T>
382
+ constexpr unspecified mem_fn(R T::*); // constexpr in C++20
380
383
381
384
class bad_function_call
382
385
: public exception
@@ -1288,12 +1291,13 @@ private:
1288
1291
type __f_;
1289
1292
1290
1293
public:
1291
- _LIBCPP_INLINE_VISIBILITY __mem_fn (type __f) _NOEXCEPT : __f_(__f) {}
1294
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1295
+ __mem_fn (type __f) _NOEXCEPT : __f_(__f) {}
1292
1296
1293
1297
#ifndef _LIBCPP_CXX03_LANG
1294
1298
// invoke
1295
1299
template <class ... _ArgTypes>
1296
- _LIBCPP_INLINE_VISIBILITY
1300
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1297
1301
typename __invoke_return<type, _ArgTypes...>::type
1298
1302
operator () (_ArgTypes&&... __args) const {
1299
1303
return _VSTD::__invoke (__f_, _VSTD::forward<_ArgTypes>(__args)...);
@@ -1401,7 +1405,7 @@ public:
1401
1405
};
1402
1406
1403
1407
template <class _Rp , class _Tp >
1404
- inline _LIBCPP_INLINE_VISIBILITY
1408
+ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1405
1409
__mem_fn<_Rp _Tp::*>
1406
1410
mem_fn (_Rp _Tp::* __pm) _NOEXCEPT
1407
1411
{
@@ -2873,13 +2877,13 @@ public:
2873
2877
!is_same<typename remove_reference<_Gp>::type,
2874
2878
__bind>::value
2875
2879
>::type>
2876
- _LIBCPP_INLINE_VISIBILITY
2880
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
2877
2881
explicit __bind (_Gp&& __f, _BA&& ...__bound_args)
2878
2882
: __f_(_VSTD::forward<_Gp>(__f)),
2879
2883
__bound_args_(_VSTD::forward<_BA>(__bound_args)...) {}
2880
2884
2881
2885
template <class ..._Args>
2882
- _LIBCPP_INLINE_VISIBILITY
2886
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
2883
2887
typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type
2884
2888
operator ()(_Args&& ...__args)
2885
2889
{
@@ -2888,7 +2892,7 @@ public:
2888
2892
}
2889
2893
2890
2894
template <class ..._Args>
2891
- _LIBCPP_INLINE_VISIBILITY
2895
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
2892
2896
typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type
2893
2897
operator ()(_Args&& ...__args) const
2894
2898
{
@@ -2918,13 +2922,13 @@ public:
2918
2922
!is_same<typename remove_reference<_Gp>::type,
2919
2923
__bind_r>::value
2920
2924
>::type>
2921
- _LIBCPP_INLINE_VISIBILITY
2925
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
2922
2926
explicit __bind_r (_Gp&& __f, _BA&& ...__bound_args)
2923
2927
: base(_VSTD::forward<_Gp>(__f),
2924
2928
_VSTD::forward<_BA>(__bound_args)...) {}
2925
2929
2926
2930
template <class ..._Args>
2927
- _LIBCPP_INLINE_VISIBILITY
2931
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
2928
2932
typename enable_if
2929
2933
<
2930
2934
is_convertible<typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type,
@@ -2938,7 +2942,7 @@ public:
2938
2942
}
2939
2943
2940
2944
template <class ..._Args>
2941
- _LIBCPP_INLINE_VISIBILITY
2945
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
2942
2946
typename enable_if
2943
2947
<
2944
2948
is_convertible<typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type,
@@ -2956,7 +2960,7 @@ template<class _Rp, class _Fp, class ..._BoundArgs>
2956
2960
struct __is_bind_expression <__bind_r<_Rp, _Fp, _BoundArgs...> > : public true_type {};
2957
2961
2958
2962
template <class _Fp , class ..._BoundArgs>
2959
- inline _LIBCPP_INLINE_VISIBILITY
2963
+ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
2960
2964
__bind<_Fp, _BoundArgs...>
2961
2965
bind (_Fp&& __f, _BoundArgs&&... __bound_args)
2962
2966
{
@@ -2965,7 +2969,7 @@ bind(_Fp&& __f, _BoundArgs&&... __bound_args)
2965
2969
}
2966
2970
2967
2971
template <class _Rp , class _Fp , class ..._BoundArgs>
2968
- inline _LIBCPP_INLINE_VISIBILITY
2972
+ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
2969
2973
__bind_r<_Rp, _Fp, _BoundArgs...>
2970
2974
bind (_Fp&& __f, _BoundArgs&&... __bound_args)
2971
2975
{
@@ -2978,7 +2982,7 @@ bind(_Fp&& __f, _BoundArgs&&... __bound_args)
2978
2982
#if _LIBCPP_STD_VER > 14
2979
2983
2980
2984
template <class _Fn , class ..._Args>
2981
- invoke_result_t <_Fn, _Args...>
2985
+ _LIBCPP_CONSTEXPR_AFTER_CXX17 invoke_result_t <_Fn, _Args...>
2982
2986
invoke (_Fn&& __f, _Args&&... __args)
2983
2987
noexcept (is_nothrow_invocable_v<_Fn, _Args...>)
2984
2988
{
@@ -2993,29 +2997,29 @@ public:
2993
2997
__not_fn_imp () = delete ;
2994
2998
2995
2999
template <class ..._Args>
2996
- _LIBCPP_INLINE_VISIBILITY
3000
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
2997
3001
auto operator ()(_Args&& ...__args) &
2998
3002
noexcept (noexcept (!_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...)))
2999
3003
-> decltype( !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...))
3000
3004
{ return !_VSTD::invoke (__fd, _VSTD::forward<_Args>(__args)...); }
3001
3005
3002
3006
template <class ..._Args>
3003
- _LIBCPP_INLINE_VISIBILITY
3007
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
3004
3008
auto operator ()(_Args&& ...__args) &&
3005
3009
noexcept (noexcept (!_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...)))
3006
3010
-> decltype( !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...))
3007
3011
{ return !_VSTD::invoke (_VSTD::move (__fd), _VSTD::forward<_Args>(__args)...); }
3008
3012
3009
3013
template <class ..._Args>
3010
- _LIBCPP_INLINE_VISIBILITY
3014
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
3011
3015
auto operator ()(_Args&& ...__args) const &
3012
3016
noexcept (noexcept (!_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...)))
3013
3017
-> decltype( !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...))
3014
3018
{ return !_VSTD::invoke (__fd, _VSTD::forward<_Args>(__args)...); }
3015
3019
3016
3020
3017
3021
template <class ..._Args>
3018
- _LIBCPP_INLINE_VISIBILITY
3022
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
3019
3023
auto operator ()(_Args&& ...__args) const &&
3020
3024
noexcept (noexcept (!_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...)))
3021
3025
-> decltype( !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...))
@@ -3024,17 +3028,17 @@ public:
3024
3028
private:
3025
3029
template <class _RawFunc ,
3026
3030
class = enable_if_t <!is_same<decay_t <_RawFunc>, __not_fn_imp>::value>>
3027
- _LIBCPP_INLINE_VISIBILITY
3031
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
3028
3032
explicit __not_fn_imp (_RawFunc&& __rf)
3029
3033
: __fd(_VSTD::forward<_RawFunc>(__rf)) {}
3030
3034
3031
3035
template <class _RawFunc >
3032
- friend inline _LIBCPP_INLINE_VISIBILITY
3036
+ friend inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
3033
3037
__not_fn_imp<decay_t <_RawFunc>> not_fn (_RawFunc&&);
3034
3038
};
3035
3039
3036
3040
template <class _RawFunc >
3037
- inline _LIBCPP_INLINE_VISIBILITY
3041
+ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
3038
3042
__not_fn_imp<decay_t <_RawFunc>> not_fn (_RawFunc&& __fn) {
3039
3043
return __not_fn_imp<decay_t <_RawFunc>>(_VSTD::forward<_RawFunc>(__fn));
3040
3044
}
@@ -3131,13 +3135,13 @@ __search(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
3131
3135
template <class _ForwardIterator , class _BinaryPredicate = equal_to<>>
3132
3136
class _LIBCPP_TYPE_VIS default_searcher {
3133
3137
public:
3134
- _LIBCPP_INLINE_VISIBILITY
3138
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
3135
3139
default_searcher (_ForwardIterator __f, _ForwardIterator __l,
3136
3140
_BinaryPredicate __p = _BinaryPredicate())
3137
3141
: __first_(__f), __last_(__l), __pred_(__p) {}
3138
3142
3139
3143
template <typename _ForwardIterator2>
3140
- _LIBCPP_INLINE_VISIBILITY
3144
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
3141
3145
pair<_ForwardIterator2, _ForwardIterator2>
3142
3146
operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const
3143
3147
{
0 commit comments