@@ -94,7 +94,7 @@ class cpp_function : public function {
94
94
template <typename Func, typename Return, typename ... Args, typename ... Extra>
95
95
void initialize (Func &&f, Return (*)(Args...), const Extra&... extra) {
96
96
using namespace detail ;
97
- struct capture { detail:: remove_reference_t <Func> f; };
97
+ struct capture { remove_reference_t <Func> f; };
98
98
99
99
/* Store the function including any extra state it might have (e.g. a lambda capture object) */
100
100
auto rec = make_function_record ();
@@ -113,55 +113,55 @@ class cpp_function : public function {
113
113
# pragma GCC diagnostic pop
114
114
#endif
115
115
if (!std::is_trivially_destructible<Func>::value)
116
- rec->free_data = [](detail:: function_record *r) { ((capture *) &r->data )->~capture (); };
116
+ rec->free_data = [](function_record *r) { ((capture *) &r->data )->~capture (); };
117
117
} else {
118
118
rec->data [0 ] = new capture { std::forward<Func>(f) };
119
- rec->free_data = [](detail:: function_record *r) { delete ((capture *) r->data [0 ]); };
119
+ rec->free_data = [](function_record *r) { delete ((capture *) r->data [0 ]); };
120
120
}
121
121
122
122
/* Type casters for the function arguments and return value */
123
- using cast_in = detail:: argument_loader<Args...>;
124
- using cast_out = detail:: make_caster<
125
- detail:: conditional_t <std::is_void<Return>::value, detail:: void_type, Return>
123
+ using cast_in = argument_loader<Args...>;
124
+ using cast_out = make_caster<
125
+ conditional_t <std::is_void<Return>::value, void_type, Return>
126
126
>;
127
127
128
- static_assert (detail:: expected_num_args<Extra...>(sizeof ...(Args), cast_in::has_args, cast_in::has_kwargs),
128
+ static_assert (expected_num_args<Extra...>(sizeof ...(Args), cast_in::has_args, cast_in::has_kwargs),
129
129
" The number of argument annotations does not match the number of function arguments" );
130
130
131
131
/* Dispatch code which converts function arguments and performs the actual function call */
132
- rec->impl = [](detail:: function_call &call) -> handle {
132
+ rec->impl = [](function_call &call) -> handle {
133
133
cast_in args_converter;
134
134
135
135
/* Try to cast the function arguments into the C++ domain */
136
136
if (!args_converter.load_args (call))
137
137
return PYBIND11_TRY_NEXT_OVERLOAD;
138
138
139
139
/* Invoke call policy pre-call hook */
140
- detail:: process_attributes<Extra...>::precall (call);
140
+ process_attributes<Extra...>::precall (call);
141
141
142
142
/* Get a pointer to the capture object */
143
143
auto data = (sizeof (capture) <= sizeof (call.func .data )
144
144
? &call.func .data : call.func .data [0 ]);
145
145
capture *cap = const_cast <capture *>(reinterpret_cast <const capture *>(data));
146
146
147
147
/* Override policy for rvalues -- usually to enforce rvp::move on an rvalue */
148
- const auto policy = detail:: return_value_policy_override<Return>::policy (call.func .policy );
148
+ const auto policy = return_value_policy_override<Return>::policy (call.func .policy );
149
149
150
150
/* Function scope guard -- defaults to the compile-to-nothing `void_type` */
151
- using Guard = detail:: extract_guard_t <Extra...>;
151
+ using Guard = extract_guard_t <Extra...>;
152
152
153
153
/* Perform the function call */
154
154
handle result = cast_out::cast (
155
155
std::move (args_converter).template call <Return, Guard>(cap->f ), policy, call.parent );
156
156
157
157
/* Invoke call policy post-call hook */
158
- detail:: process_attributes<Extra...>::postcall (call, result);
158
+ process_attributes<Extra...>::postcall (call, result);
159
159
160
160
return result;
161
161
};
162
162
163
163
/* Process any user-provided function attributes */
164
- detail:: process_attributes<Extra...>::init (extra..., rec);
164
+ process_attributes<Extra...>::init (extra..., rec);
165
165
166
166
/* Generate a readable signature describing the function's arguments and return value types */
167
167
static constexpr auto signature = _ (" (" ) + cast_in::arg_names + _ (" ) -> " ) + cast_out::name;
0 commit comments