diff --git a/include/nanobind/nb_class.h b/include/nanobind/nb_class.h index daf2462b..eeb8e328 100644 --- a/include/nanobind/nb_class.h +++ b/include/nanobind/nb_class.h @@ -442,8 +442,8 @@ struct new_ { std::is_same_v, kwargs>) + ... + 0); detail::wrap_base_new(cl, sizeof...(Args) > num_defaults + num_varargs); - auto wrapper = [func = (detail::forward_t) func](handle, Args... args) { - return func((detail::forward_t) args...); + auto wrapper = [func_ = (detail::forward_t) func](handle, Args... args) { + return func_((detail::forward_t) args...); }; if constexpr ((std::is_base_of_v || ...)) {