compile time check that properties have no py:arg values (#1524)

This commit is contained in:
Jeff VanOss 2019-06-11 08:25:35 -04:00 committed by Wenzel Jakob
parent 000aabb2a7
commit 77ef03d5b1

View File

@ -1266,6 +1266,8 @@ public:
/// Uses cpp_function's return_value_policy by default
template <typename... Extra>
class_ &def_property_static(const char *name, const cpp_function &fget, const cpp_function &fset, const Extra& ...extra) {
static_assert( 0 == detail::constexpr_sum(std::is_base_of<arg, Extra>::value...),
"Argument annotations are not allowed for properties");
auto rec_fget = get_function_record(fget), rec_fset = get_function_record(fset);
auto *rec_active = rec_fget;
if (rec_fget) {