This commit is contained in:
gentlegiantJGC 2025-02-19 21:34:55 +01:00 committed by GitHub
commit 6dc50ae45b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions

View File

@ -686,6 +686,12 @@ struct process_attributes {
} }
}; };
template <typename T>
struct is_keep_alive : std::false_type {};
template <size_t Nurse, size_t Patient>
struct is_keep_alive<keep_alive<Nurse, Patient>> : std::true_type {};
template <typename T> template <typename T>
using is_call_guard = is_instantiation<call_guard, T>; using is_call_guard = is_instantiation<call_guard, T>;

View File

@ -1912,6 +1912,12 @@ public:
const Extra &...extra) { const Extra &...extra) {
static_assert(0 == detail::constexpr_sum(std::is_base_of<arg, Extra>::value...), static_assert(0 == detail::constexpr_sum(std::is_base_of<arg, Extra>::value...),
"Argument annotations are not allowed for properties"); "Argument annotations are not allowed for properties");
static_assert(0 == detail::constexpr_sum(detail::is_call_guard<Extra>::value...),
"def_property family does not currently support call_guard. Use a "
"py::cpp_function instead.");
static_assert(0 == detail::constexpr_sum(detail::is_keep_alive<Extra>::value...),
"def_property family does not currently support keep_alive. Use a "
"py::cpp_function instead.");
auto rec_fget = get_function_record(fget), rec_fset = get_function_record(fset); auto rec_fget = get_function_record(fget), rec_fset = get_function_record(fset);
auto *rec_active = rec_fget; auto *rec_active = rec_fget;
if (rec_fget) { if (rec_fget) {