@auto_js/utility 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/functional/bind.cc +2 -0
- package/package.json +1 -1
- package/type_traits/function_traits.cc +11 -1
package/functional/bind.cc
CHANGED
|
@@ -88,6 +88,8 @@ class bind_explicit<Invocable, auto(Args...) noexcept(Nx)->Result, Bound...> : p
|
|
|
88
88
|
|
|
89
89
|
public:
|
|
90
90
|
using storage_type::storage_type;
|
|
91
|
+
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125779
|
|
92
|
+
using function_signature = auto(Args...) noexcept(Nx) -> Result;
|
|
91
93
|
|
|
92
94
|
// This overload allows `std::invocable<bind<...>>` without a reference, which makes concept
|
|
93
95
|
// parameters work correctly.
|
package/package.json
CHANGED
|
@@ -120,9 +120,19 @@ template <class Function>
|
|
|
120
120
|
struct function_signature<Function>
|
|
121
121
|
: remove_function_cvref<std::remove_pointer_t<std::decay_t<Function>>> {};
|
|
122
122
|
|
|
123
|
+
// Explicit function signature for `util::bind`
|
|
124
|
+
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125779
|
|
125
|
+
template <class Type>
|
|
126
|
+
concept has_explicit_function_signature = requires { typename Type::function_signature; };
|
|
127
|
+
|
|
128
|
+
template <has_explicit_function_signature Type>
|
|
129
|
+
struct function_signature<Type> : std::type_identity<typename Type::function_signature> {};
|
|
130
|
+
|
|
123
131
|
// Struct type with `operator()` (lambda, etc)
|
|
124
132
|
template <class Type>
|
|
125
|
-
|
|
133
|
+
concept has_function_call_operator = requires { &std::remove_cvref_t<Type>::operator(); };
|
|
134
|
+
template <has_function_call_operator Type>
|
|
135
|
+
requires(!has_explicit_function_signature<Type>)
|
|
126
136
|
struct function_signature<Type>
|
|
127
137
|
: function_operator_signature<Type, unbound_member_function_signature_t<decltype(&std::remove_cvref_t<Type>::operator())>> {};
|
|
128
138
|
|