[C++-sig] Re: make_getter problem
David Abrahams
dave at boost-consulting.com
Thu May 22 00:28:10 CEST 2003
"Ralf W. Grosse-Kunstleve" <rwgk at yahoo.com> writes:
> The code below comiles and works as expected with Boost 1.30.0, but fails to
> compile with the current CVS state (see attached error message) unless the
> add_property line is commented out. What could be wrong?
> Thanks,
> Ralf
>
> #include <boost/python/module.hpp>
> #include <boost/python/class.hpp>
>
> namespace sandbx { namespace {
>
> struct trivial
> {
> trivial() : value(123) {}
> double value;
> };
>
> void init_module()
> {
> using namespace boost::python;
> class_<trivial>("trivial")
> .add_property("property", make_getter(&trivial::value,
> return_value_policy<return_by_value>()))
> .def_readonly("readonly", &trivial::value)
> ;
> }
>
> }} // namespace sandbx::<anonymous>
>
> BOOST_PYTHON_MODULE(make_getter)
> {
> sandbx::init_module();
> }
>
Please try again with the latest CVS.
--
Dave Abrahams
Boost Consulting
www.boost-consulting.com
More information about the Cplusplus-sig
mailing list