Commit 77ef03d5 by Jeff VanOss Committed by Wenzel Jakob

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

parent 000aabb2
...@@ -1266,6 +1266,8 @@ public: ...@@ -1266,6 +1266,8 @@ public:
/// Uses cpp_function's return_value_policy by default /// Uses cpp_function's return_value_policy by default
template <typename... Extra> template <typename... Extra>
class_ &def_property_static(const char *name, const cpp_function &fget, const cpp_function &fset, const Extra& ...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_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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment