Skip to content

Commit 657a51e

Browse files
committed
Remove unnecessary detail::
This function already has a `using namespace detail`, so all the `detail::` qualifications are not needed.
1 parent adbc811 commit 657a51e

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

include/pybind11/pybind11.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class cpp_function : public function {
9494
template <typename Func, typename Return, typename... Args, typename... Extra>
9595
void initialize(Func &&f, Return (*)(Args...), const Extra&... extra) {
9696
using namespace detail;
97-
struct capture { detail::remove_reference_t<Func> f; };
97+
struct capture { remove_reference_t<Func> f; };
9898

9999
/* Store the function including any extra state it might have (e.g. a lambda capture object) */
100100
auto rec = make_function_record();
@@ -113,55 +113,55 @@ class cpp_function : public function {
113113
# pragma GCC diagnostic pop
114114
#endif
115115
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(); };
117117
} else {
118118
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]); };
120120
}
121121

122122
/* 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>
126126
>;
127127

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),
129129
"The number of argument annotations does not match the number of function arguments");
130130

131131
/* 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 {
133133
cast_in args_converter;
134134

135135
/* Try to cast the function arguments into the C++ domain */
136136
if (!args_converter.load_args(call))
137137
return PYBIND11_TRY_NEXT_OVERLOAD;
138138

139139
/* Invoke call policy pre-call hook */
140-
detail::process_attributes<Extra...>::precall(call);
140+
process_attributes<Extra...>::precall(call);
141141

142142
/* Get a pointer to the capture object */
143143
auto data = (sizeof(capture) <= sizeof(call.func.data)
144144
? &call.func.data : call.func.data[0]);
145145
capture *cap = const_cast<capture *>(reinterpret_cast<const capture *>(data));
146146

147147
/* 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);
149149

150150
/* 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...>;
152152

153153
/* Perform the function call */
154154
handle result = cast_out::cast(
155155
std::move(args_converter).template call<Return, Guard>(cap->f), policy, call.parent);
156156

157157
/* Invoke call policy post-call hook */
158-
detail::process_attributes<Extra...>::postcall(call, result);
158+
process_attributes<Extra...>::postcall(call, result);
159159

160160
return result;
161161
};
162162

163163
/* Process any user-provided function attributes */
164-
detail::process_attributes<Extra...>::init(extra..., rec);
164+
process_attributes<Extra...>::init(extra..., rec);
165165

166166
/* Generate a readable signature describing the function's arguments and return value types */
167167
static constexpr auto signature = _("(") + cast_in::arg_names + _(") -> ") + cast_out::name;

0 commit comments

Comments
 (0)