@@ -124,8 +124,9 @@ class cpp_function : public function {
124124 typename = detail::enable_if_t <detail::is_lambda<Func>::value>>
125125 // NOLINTNEXTLINE(google-explicit-constructor)
126126 cpp_function (Func &&f, Extra &&...extra ) {
127- initialize (
128- std::forward<Func>(f), (detail::function_signature_t <Func> *) nullptr , std::forward<Extra>(extra)...);
127+ initialize (std::forward<Func>(f),
128+ (detail::function_signature_t <Func> *) nullptr ,
129+ std::forward<Extra>(extra)...);
129130 }
130131
131132 // / Construct a cpp_function from a class method (non-const, no ref-qualifier)
@@ -191,7 +192,7 @@ class cpp_function : public function {
191192
192193 // / Special internal constructor for functors, lambda functions, etc.
193194 template <typename Func, typename Return, typename ... Args, typename ... Extra>
194- void initialize (Func &&f, Return (*)(Args...), Extra &&... extra) {
195+ void initialize (Func &&f, Return (*)(Args...), Extra &&...extra ) {
195196 using namespace detail ;
196197 struct capture {
197198 remove_reference_t <Func> f;
@@ -1728,7 +1729,11 @@ class class_ : public detail::generic_type {
17281729 " def_readwrite() requires a class member (or base class member)" );
17291730 cpp_function fget ([pm](const type &c) -> const D & { return c.*pm; }, is_method (*this )),
17301731 fset ([pm](type &c, const D &value) { c.*pm = value; }, is_method (*this ));
1731- def_property (name, fget, fset, return_value_policy::reference_internal, std::forward<Extra>(extra)...);
1732+ def_property (name,
1733+ fget,
1734+ fset,
1735+ return_value_policy::reference_internal,
1736+ std::forward<Extra>(extra)...);
17321737 return *this ;
17331738 }
17341739
@@ -1737,22 +1742,25 @@ class class_ : public detail::generic_type {
17371742 static_assert (std::is_same<C, type>::value || std::is_base_of<C, type>::value,
17381743 " def_readonly() requires a class member (or base class member)" );
17391744 cpp_function fget ([pm](const type &c) -> const D & { return c.*pm; }, is_method (*this ));
1740- def_property_readonly (name, fget, return_value_policy::reference_internal, std::forward<Extra>(extra)...);
1745+ def_property_readonly (
1746+ name, fget, return_value_policy::reference_internal, std::forward<Extra>(extra)...);
17411747 return *this ;
17421748 }
17431749
17441750 template <typename D, typename ... Extra>
17451751 class_ &def_readwrite_static (const char *name, D *pm, Extra &&...extra) {
17461752 cpp_function fget ([pm](const object &) -> const D & { return *pm; }, scope (*this )),
17471753 fset ([pm](const object &, const D &value) { *pm = value; }, scope (*this ));
1748- def_property_static (name, fget, fset, return_value_policy::reference, std::forward<Extra>(extra)...);
1754+ def_property_static (
1755+ name, fget, fset, return_value_policy::reference, std::forward<Extra>(extra)...);
17491756 return *this ;
17501757 }
17511758
17521759 template <typename D, typename ... Extra>
17531760 class_ &def_readonly_static (const char *name, const D *pm, Extra &&...extra) {
17541761 cpp_function fget ([pm](const object &) -> const D & { return *pm; }, scope (*this ));
1755- def_property_readonly_static (name, fget, return_value_policy::reference, std::forward<Extra>(extra)...);
1762+ def_property_readonly_static (
1763+ name, fget, return_value_policy::reference, std::forward<Extra>(extra)...);
17561764 return *this ;
17571765 }
17581766
@@ -1767,33 +1775,34 @@ class class_ : public detail::generic_type {
17671775
17681776 // / Uses cpp_function's return_value_policy by default
17691777 template <typename ... Extra>
1770- class_ &
1771- def_property_readonly (const char *name, const cpp_function &fget, Extra &&...extra) {
1778+ class_ &def_property_readonly (const char *name, const cpp_function &fget, Extra &&...extra) {
17721779 return def_property (name, fget, nullptr , std::forward<Extra>(extra)...);
17731780 }
17741781
17751782 // / Uses return_value_policy::reference by default
17761783 template <typename Getter, typename ... Extra>
1777- class_ &
1778- def_property_readonly_static (const char *name, const Getter &fget, Extra &&...extra) {
1779- return def_property_readonly_static (
1780- name, cpp_function (fget), return_value_policy::reference, std::forward<Extra>(extra)...);
1784+ class_ &def_property_readonly_static (const char *name, const Getter &fget, Extra &&...extra) {
1785+ return def_property_readonly_static (name,
1786+ cpp_function (fget),
1787+ return_value_policy::reference,
1788+ std::forward<Extra>(extra)...);
17811789 }
17821790
17831791 // / Uses cpp_function's return_value_policy by default
17841792 template <typename ... Extra>
1785- class_ &def_property_readonly_static (const char *name,
1786- const cpp_function &fget,
1787- Extra &&...extra) {
1793+ class_ &
1794+ def_property_readonly_static (const char *name, const cpp_function &fget, Extra &&...extra) {
17881795 return def_property_static (name, fget, nullptr , std::forward<Extra>(extra)...);
17891796 }
17901797
17911798 // / Uses return_value_policy::reference_internal by default
17921799 template <typename Getter, typename Setter, typename ... Extra>
17931800 class_ &
17941801 def_property (const char *name, const Getter &fget, const Setter &fset, Extra &&...extra) {
1795- return def_property (
1796- name, fget, cpp_function (method_adaptor<type>(fset), is_setter ()), std::forward<Extra>(extra)...);
1802+ return def_property (name,
1803+ fget,
1804+ cpp_function (method_adaptor<type>(fset), is_setter ()),
1805+ std::forward<Extra>(extra)...);
17971806 }
17981807 template <typename Getter, typename ... Extra>
17991808 class_ &def_property (const char *name,
@@ -1813,7 +1822,8 @@ class class_ : public detail::generic_type {
18131822 const cpp_function &fget,
18141823 const cpp_function &fset,
18151824 Extra &&...extra) {
1816- return def_property_static (name, fget, fset, is_method (*this ), std::forward<Extra>(extra)...);
1825+ return def_property_static (
1826+ name, fget, fset, is_method (*this ), std::forward<Extra>(extra)...);
18171827 }
18181828
18191829 // / Uses return_value_policy::reference by default
@@ -1822,8 +1832,11 @@ class class_ : public detail::generic_type {
18221832 const Getter &fget,
18231833 const cpp_function &fset,
18241834 Extra &&...extra) {
1825- return def_property_static (
1826- name, cpp_function (fget), fset, return_value_policy::reference, std::forward<Extra>(extra)...);
1835+ return def_property_static (name,
1836+ cpp_function (fget),
1837+ fset,
1838+ return_value_policy::reference,
1839+ std::forward<Extra>(extra)...);
18271840 }
18281841
18291842 // / Uses cpp_function's return_value_policy by default
0 commit comments