Skip to content

Commit

Permalink
Simpler fix for the regression introduced in pybind#5381
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco-ballarin committed Oct 6, 2024
1 parent 95e0325 commit 8cbca65
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions include/pybind11/cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -1569,10 +1569,16 @@ template <typename... Args>
class argument_loader {
using indices = make_index_sequence<sizeof...(Args)>;

// See PR #5396 for the discussion that led to using
// any_of<std::is_same<...>, std::is_base_of<...>>
// instead of simply
// std::is_base_of<...>
template <typename Arg>
using argument_is_args = std::is_base_of<args, intrinsic_t<Arg>>;
using argument_is_args = any_of<
std::is_same<intrinsic_t<Arg>, args>, std::is_base_of<args, intrinsic_t<Arg>>>;
template <typename Arg>
using argument_is_kwargs = std::is_base_of<kwargs, intrinsic_t<Arg>>;
using argument_is_kwargs = any_of<
std::is_same<intrinsic_t<Arg>, kwargs>, std::is_base_of<kwargs, intrinsic_t<Arg>>>;
// Get kwargs argument position, or -1 if not present:
static constexpr auto kwargs_pos = constexpr_last<argument_is_kwargs, Args...>();

Expand Down

0 comments on commit 8cbca65

Please sign in to comment.