@@ -1728,7 +1728,11 @@ class class_ : public detail::generic_type {
1728
1728
" def_readwrite() requires a class member (or base class member)" );
1729
1729
cpp_function fget ([pm](const type &c) -> const D & { return c.*pm; }, is_method (*this )),
1730
1730
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)...);
1731
+ def_property (name,
1732
+ fget,
1733
+ fset,
1734
+ return_value_policy::reference_internal,
1735
+ std::forward<Extra>(extra)...);
1732
1736
return *this ;
1733
1737
}
1734
1738
@@ -1737,22 +1741,25 @@ class class_ : public detail::generic_type {
1737
1741
static_assert (std::is_same<C, type>::value || std::is_base_of<C, type>::value,
1738
1742
" def_readonly() requires a class member (or base class member)" );
1739
1743
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)...);
1744
+ def_property_readonly (
1745
+ name, fget, return_value_policy::reference_internal, std::forward<Extra>(extra)...);
1741
1746
return *this ;
1742
1747
}
1743
1748
1744
1749
template <typename D, typename ... Extra>
1745
1750
class_ &def_readwrite_static (const char *name, D *pm, Extra &&...extra) {
1746
1751
cpp_function fget ([pm](const object &) -> const D & { return *pm; }, scope (*this )),
1747
1752
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)...);
1753
+ def_property_static (
1754
+ name, fget, fset, return_value_policy::reference, std::forward<Extra>(extra)...);
1749
1755
return *this ;
1750
1756
}
1751
1757
1752
1758
template <typename D, typename ... Extra>
1753
1759
class_ &def_readonly_static (const char *name, const D *pm, Extra &&...extra) {
1754
1760
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)...);
1761
+ def_property_readonly_static (
1762
+ name, fget, return_value_policy::reference, std::forward<Extra>(extra)...);
1756
1763
return *this ;
1757
1764
}
1758
1765
@@ -1767,33 +1774,34 @@ class class_ : public detail::generic_type {
1767
1774
1768
1775
// / Uses cpp_function's return_value_policy by default
1769
1776
template <typename ... Extra>
1770
- class_ &
1771
- def_property_readonly (const char *name, const cpp_function &fget, Extra &&...extra) {
1777
+ class_ &def_property_readonly (const char *name, const cpp_function &fget, Extra &&...extra) {
1772
1778
return def_property (name, fget, nullptr , std::forward<Extra>(extra)...);
1773
1779
}
1774
1780
1775
1781
// / Uses return_value_policy::reference by default
1776
1782
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)...);
1783
+ class_ &def_property_readonly_static (const char *name, const Getter &fget, Extra &&...extra) {
1784
+ return def_property_readonly_static (name,
1785
+ cpp_function (fget),
1786
+ return_value_policy::reference,
1787
+ std::forward<Extra>(extra)...);
1781
1788
}
1782
1789
1783
1790
// / Uses cpp_function's return_value_policy by default
1784
1791
template <typename ... Extra>
1785
- class_ &def_property_readonly_static (const char *name,
1786
- const cpp_function &fget,
1787
- Extra &&...extra) {
1792
+ class_ &
1793
+ def_property_readonly_static (const char *name, const cpp_function &fget, Extra &&...extra) {
1788
1794
return def_property_static (name, fget, nullptr , std::forward<Extra>(extra)...);
1789
1795
}
1790
1796
1791
1797
// / Uses return_value_policy::reference_internal by default
1792
1798
template <typename Getter, typename Setter, typename ... Extra>
1793
1799
class_ &
1794
1800
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)...);
1801
+ return def_property (name,
1802
+ fget,
1803
+ cpp_function (method_adaptor<type>(fset), is_setter ()),
1804
+ std::forward<Extra>(extra)...);
1797
1805
}
1798
1806
template <typename Getter, typename ... Extra>
1799
1807
class_ &def_property (const char *name,
@@ -1813,7 +1821,8 @@ class class_ : public detail::generic_type {
1813
1821
const cpp_function &fget,
1814
1822
const cpp_function &fset,
1815
1823
Extra &&...extra) {
1816
- return def_property_static (name, fget, fset, is_method (*this ), std::forward<Extra>(extra)...);
1824
+ return def_property_static (
1825
+ name, fget, fset, is_method (*this ), std::forward<Extra>(extra)...);
1817
1826
}
1818
1827
1819
1828
// / Uses return_value_policy::reference by default
@@ -1822,8 +1831,11 @@ class class_ : public detail::generic_type {
1822
1831
const Getter &fget,
1823
1832
const cpp_function &fset,
1824
1833
Extra &&...extra) {
1825
- return def_property_static (
1826
- name, cpp_function (fget), fset, return_value_policy::reference, std::forward<Extra>(extra)...);
1834
+ return def_property_static (name,
1835
+ cpp_function (fget),
1836
+ fset,
1837
+ return_value_policy::reference,
1838
+ std::forward<Extra>(extra)...);
1827
1839
}
1828
1840
1829
1841
// / Uses cpp_function's return_value_policy by default
0 commit comments