@@ -1412,15 +1412,15 @@ class class_ : public detail::generic_type {
14121412
14131413 template <typename D, typename ... Extra>
14141414 class_ &def_readwrite_static (const char *name, D *pm, const Extra& ...extra) {
1415- cpp_function fget ([pm](object) -> const D &{ return *pm; }, scope (*this )),
1416- fset ([pm](object, const D &value) { *pm = value; }, scope (*this ));
1415+ cpp_function fget ([pm](const object & ) -> const D & { return *pm; }, scope (*this )),
1416+ fset ([pm](const object & , const D &value) { *pm = value; }, scope (*this ));
14171417 def_property_static (name, fget, fset, return_value_policy::reference, extra...);
14181418 return *this ;
14191419 }
14201420
14211421 template <typename D, typename ... Extra>
14221422 class_ &def_readonly_static (const char *name, const D *pm, const Extra& ...extra) {
1423- cpp_function fget ([pm](object) -> const D &{ return *pm; }, scope (*this ));
1423+ cpp_function fget ([pm](const object & ) -> const D & { return *pm; }, scope (*this ));
14241424 def_property_readonly_static (name, fget, return_value_policy::reference, extra...);
14251425 return *this ;
14261426 }
@@ -1671,30 +1671,36 @@ struct enum_base {
16711671 }, name (" __members__" )), none (), none (), " "
16721672 );
16731673
1674- #define PYBIND11_ENUM_OP_STRICT (op, expr, strict_behavior ) \
1675- m_base.attr (op) = cpp_function ( \
1676- [](object a, object b) { \
1677- if (!type::handle_of (a).is (type::handle_of (b))) \
1678- strict_behavior; \
1679- return expr; \
1680- }, \
1681- name (op), is_method (m_base), arg (" other" ))
1682-
1683- #define PYBIND11_ENUM_OP_CONV (op, expr ) \
1684- m_base.attr (op) = cpp_function ( \
1685- [](object a_, object b_) { \
1686- int_ a (a_), b (b_); \
1687- return expr; \
1688- }, \
1689- name (op), is_method (m_base), arg (" other" ))
1690-
1691- #define PYBIND11_ENUM_OP_CONV_LHS (op, expr ) \
1692- m_base.attr (op) = cpp_function ( \
1693- [](object a_, object b) { \
1694- int_ a (a_); \
1695- return expr; \
1696- }, \
1697- name (op), is_method (m_base), arg (" other" ))
1674+ #define PYBIND11_ENUM_OP_STRICT (op, expr, strict_behavior ) \
1675+ m_base.attr (op) = cpp_function ( \
1676+ [](const object &a, const object &b) { \
1677+ if (!type::handle_of (a).is (type::handle_of (b))) \
1678+ strict_behavior; \
1679+ return expr; \
1680+ }, \
1681+ name (op), \
1682+ is_method (m_base), \
1683+ arg (" other" ))
1684+
1685+ #define PYBIND11_ENUM_OP_CONV (op, expr ) \
1686+ m_base.attr (op) = cpp_function ( \
1687+ [](const object &a_, const object &b_) { \
1688+ int_ a (a_), b (b_); \
1689+ return expr; \
1690+ }, \
1691+ name (op), \
1692+ is_method (m_base), \
1693+ arg (" other" ))
1694+
1695+ #define PYBIND11_ENUM_OP_CONV_LHS (op, expr ) \
1696+ m_base.attr (op) = cpp_function ( \
1697+ [](const object &a_, const object &b) { \
1698+ int_ a (a_); \
1699+ return expr; \
1700+ }, \
1701+ name (op), \
1702+ is_method (m_base), \
1703+ arg (" other" ))
16981704
16991705 if (is_convertible) {
17001706 PYBIND11_ENUM_OP_CONV_LHS (" __eq__" , !b.is_none () && a.equal (b));
@@ -2054,7 +2060,7 @@ exception<CppException> ®ister_exception(handle scope,
20542060}
20552061
20562062PYBIND11_NAMESPACE_BEGIN (detail)
2057- PYBIND11_NOINLINE inline void print (tuple args, dict kwargs) {
2063+ PYBIND11_NOINLINE inline void print (const tuple & args, const dict & kwargs) {
20582064 auto strings = tuple (args.size ());
20592065 for (size_t i = 0 ; i < args.size (); ++i) {
20602066 strings[i] = str (args[i]);
0 commit comments