Skip to content

Commit ec77571

Browse files
[libc++][NFC] Remove __weak_result_type<F&> partial specializations
Currently, libc++ defines partial specializations of `__weak_result_type` for function lvalue references. However, they can never be validly used. `__weak_result_type` is only used as base classes of these classes: - `reference_wrapper`, where it's already invalid to instantiate `reference_wrapper<F&>`; - `__mem_fn` (the return type of `std::mem_fn`), where the template argument must be a pointer to member function type; - `__bind_fn` (the return type of `std::bind`), where the template argument is already decayed and thus never a reference. So `__weak_result_type<F&>` is useless and should probably be removed.
1 parent 5dd2b06 commit ec77571

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

libcxx/include/__functional/weak_result_type.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,6 @@ struct __weak_result_type<_Rp()> {
9797
#endif
9898
};
9999

100-
template <class _Rp>
101-
struct __weak_result_type<_Rp (&)()> {
102-
#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
103-
using result_type _LIBCPP_NODEBUG _LIBCPP_DEPRECATED_IN_CXX17 = _Rp;
104-
#endif
105-
};
106-
107100
template <class _Rp>
108101
struct __weak_result_type<_Rp (*)()> {
109102
#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
@@ -116,9 +109,6 @@ struct __weak_result_type<_Rp (*)()> {
116109
template <class _Rp, class _A1>
117110
struct __weak_result_type<_Rp(_A1)> : public __unary_function<_A1, _Rp> {};
118111

119-
template <class _Rp, class _A1>
120-
struct __weak_result_type<_Rp (&)(_A1)> : public __unary_function<_A1, _Rp> {};
121-
122112
template <class _Rp, class _A1>
123113
struct __weak_result_type<_Rp (*)(_A1)> : public __unary_function<_A1, _Rp> {};
124114

@@ -142,9 +132,6 @@ struct __weak_result_type<_Rp(_A1, _A2)> : public __binary_function<_A1, _A2, _R
142132
template <class _Rp, class _A1, class _A2>
143133
struct __weak_result_type<_Rp (*)(_A1, _A2)> : public __binary_function<_A1, _A2, _Rp> {};
144134

145-
template <class _Rp, class _A1, class _A2>
146-
struct __weak_result_type<_Rp (&)(_A1, _A2)> : public __binary_function<_A1, _A2, _Rp> {};
147-
148135
template <class _Rp, class _Cp, class _A1>
149136
struct __weak_result_type<_Rp (_Cp::*)(_A1)> : public __binary_function<_Cp*, _A1, _Rp> {};
150137

@@ -167,13 +154,6 @@ struct __weak_result_type<_Rp(_A1, _A2, _A3, _A4...)> {
167154
#endif
168155
};
169156

170-
template <class _Rp, class _A1, class _A2, class _A3, class... _A4>
171-
struct __weak_result_type<_Rp (&)(_A1, _A2, _A3, _A4...)> {
172-
#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
173-
using result_type _LIBCPP_NODEBUG _LIBCPP_DEPRECATED_IN_CXX17 = _Rp;
174-
#endif
175-
};
176-
177157
template <class _Rp, class _A1, class _A2, class _A3, class... _A4>
178158
struct __weak_result_type<_Rp (*)(_A1, _A2, _A3, _A4...)> {
179159
#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)

0 commit comments

Comments
 (0)