Skip to content

Commit 2dfa0b0

Browse files
committed
CReturn/AReturn are no longer needed
1 parent 2ac010c commit 2dfa0b0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

include/pybind11/detail/init.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ template <typename... Args> struct alias_constructor {
220220
};
221221

222222
// Implementation class for py::init(Func) and py::init(Func, AliasFunc)
223-
template <typename CFunc, typename CReturn, typename AFuncIn, typename AReturn, typename... Args> struct factory {
223+
template <typename CFunc, typename AFuncIn, typename... Args> struct factory {
224224
private:
225225
using CFuncType = typename std::remove_reference<CFunc>::type;
226226
using AFunc = conditional_t<std::is_void<AFuncIn>::value, void_type, AFuncIn>;
@@ -301,7 +301,7 @@ template <typename Func> using functype =
301301

302302
// Helper definition to infer the detail::initimpl::factory template types from a callable object
303303
template <typename Func, typename Return, typename... Args>
304-
factory<functype<Func>, Return, void, void, Args...> func_decltype(Return (*)(Args...));
304+
factory<functype<Func>, void, Args...> func_decltype(Return (*)(Args...));
305305

306306
// metatemplate that ensures the Class and Alias factories take identical arguments: we need to be
307307
// able to call either one with the given arguments (depending on the final instance type).
@@ -320,8 +320,7 @@ inline constexpr bool require_matching_arguments(Return1 (*)(Args1...), Return2
320320
template <typename CFunc, typename AFunc,
321321
typename CReturn, typename... CArgs, typename AReturn, typename... AArgs,
322322
bool = require_matching_arguments((CReturn (*)(CArgs...)) nullptr, (AReturn (*)(AArgs...)) nullptr)>
323-
factory<functype<CFunc>, CReturn, functype<AFunc>, AReturn, CArgs...> func_decltype(
324-
CReturn (*)(CArgs...), AReturn (*)(AArgs...));
323+
factory<functype<CFunc>, functype<AFunc>, CArgs...> func_decltype(CReturn (*)(CArgs...), AReturn (*)(AArgs...));
325324

326325
// Resolves to the appropriate specialization of the `pybind11::detail::initimpl::factory<...>` for a
327326
// given init function or pair of class/alias init functions.

0 commit comments

Comments
 (0)