Boost C++ Libraries: Ticket #3654: Functions created via make_getter don't seem to use converters https://svn.boost.org/trac10/ticket/3654 <p> I have a converter registered for a boost::optional&lt;amount_t&gt; object. If I use it as follows, my code works just fine: </p> <blockquote> <p> boost::optional&lt;amount_t&gt; py_price(annotation_t&amp; ann) { </p> <blockquote> <p> return ann.price; </p> </blockquote> <p> } </p> </blockquote> <blockquote> <p> class_&lt; annotation_t &gt; ("Annotation") </p> <blockquote> <p> .add_property("price", py_price) ; </p> </blockquote> </blockquote> <p> However, if I dispense with the intermediary and use make_getter, I get an exception stating that no conversion exists for optional&lt;amount_t&gt;: </p> <blockquote> <p> class_&lt; annotation_t &gt; ("Annotation") </p> <blockquote> <p> .add_property("price", make_getter(&amp;annotation_t::price)) ; </p> </blockquote> </blockquote> <p> The attached file demonstrates this bug using Boost 1.40 and Python 2.6.1. I'm running it on OS X 10.6.2 with g++ 4.4.2. My steps were: </p> <p> g++-mp-4.4 -I/usr/include/python2.6 -I/usr/local/include/boost-1_40 -o bug.so bug.cc -L/usr/local/lib -lboost_python-xgcc44-d-1_40 -lpython -shared </p> <p> $ python import bug x = bug.Annotation() x.price2 # This works just fine x.price # This causes an abort() due to terminate() </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3654 Trac 1.4.3 John Wiegley <jwiegley@…> Sat, 21 Nov 2009 05:17:17 GMT attachment set https://svn.boost.org/trac10/ticket/3654 https://svn.boost.org/trac10/ticket/3654 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">bug.cc</span> </li> </ul> <p> Simple case that demonstrates the issue </p> Ticket John Wiegley <jwiegley@…> Sat, 21 Nov 2009 22:01:09 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/3654#comment:1 https://svn.boost.org/trac10/ticket/3654#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> This is answered by the Boost.Python FAQ. </p> Ticket