From 3f14ae34a0fcf76676bd3fdb45669da18d3e5195 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Fri, 12 Jan 2024 09:42:40 -0800 Subject: [PATCH] Minor move of code blocks (no functional change). --- include/pybind11/stl.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/include/pybind11/stl.h b/include/pybind11/stl.h index 06bb288b..8424004b 100644 --- a/include/pybind11/stl.h +++ b/include/pybind11/stl.h @@ -368,6 +368,8 @@ struct array_caster { using value_conv = make_caster; private: + std::unique_ptr value; + template = 0> bool convert_elements(handle seq, bool convert) { auto l = reinterpret_borrow(seq); @@ -446,16 +448,6 @@ struct array_caster { return l.release(); } -protected: - std::unique_ptr value; - -public: - static constexpr auto name - = const_name(const_name(""), const_name("Annotated[")) + const_name("list[") - + value_conv::name + const_name("]") - + const_name( - const_name(""), const_name(", FixedSize(") + const_name() + const_name(")]")); - // Code copied from PYBIND11_TYPE_CASTER macro. template >::value, int> = 0> static handle cast(T_ *src, const return_value_policy_pack &policy, handle parent) { @@ -479,6 +471,12 @@ struct array_caster { template using cast_op_type = movable_cast_op_type; + + static constexpr auto name + = const_name(const_name(""), const_name("Annotated[")) + const_name("list[") + + value_conv::name + const_name("]") + + const_name( + const_name(""), const_name(", FixedSize(") + const_name() + const_name(")]")); }; template