Skip to content

Commit

Permalink
style: pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Nov 27, 2024
1 parent cb56233 commit 8816f52
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/pybind11/cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -870,18 +870,18 @@ struct always_construct_holder {

// Avoid -Wgnu-zero-variadic-macro-arguments in C++20 on clang
#ifdef PYBIND11_CPP20
#define PYBIND11_DECLARE_HOLDER_TYPE_ARGS(...) void __VA_OPT__(,) __VA_ARGS__
# define PYBIND11_DECLARE_HOLDER_TYPE_ARGS(...) void __VA_OPT__(, ) __VA_ARGS__
#else
#define PYBIND11_DECLARE_HOLDER_TYPE_ARGS(...) void, ##__VA_ARGS__
# define PYBIND11_DECLARE_HOLDER_TYPE_ARGS(...) void, ##__VA_ARGS__
#endif

/// Create a specialization for custom holder types (silently ignores std::shared_ptr)
#define PYBIND11_DECLARE_HOLDER_TYPE(type, holder_type, ...) \
PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE) \
namespace detail { \
template <typename type> \
struct always_construct_holder<holder_type> : always_construct_holder<PYBIND11_DECLARE_HOLDER_TYPE_ARGS(__VA_ARGS__)> { \
}; \
struct always_construct_holder<holder_type> \
: always_construct_holder<PYBIND11_DECLARE_HOLDER_TYPE_ARGS(__VA_ARGS__)> {}; \
template <typename type> \
class type_caster<holder_type, enable_if_t<!is_shared_ptr<holder_type>::value>> \
: public type_caster_holder<type, holder_type> {}; \
Expand Down

0 comments on commit 8816f52

Please sign in to comment.