[C++-sig] Protected destructor compile error

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Fri Jun 23 01:22:09 CEST 2006

--- Roman Yakovenko <roman.yakovenko at gmail.com> wrote:

> On 6/22/06, David Abrahams <dave at boost-consulting.com> wrote:
> > Boost.Python assumes that a const reference argument means that the
> > function can accept "rvalues", e.g. objects implicitly converted from
> > other python types.
> I am sure I am missing something trivial.
> Why Boost.Python does such assumption? In my opinion Boost.Python, in this
> case
> does not have to make any assumption.
> If user want to enjoy from conversion he should register it, right? He
> does this using:
> 1. implicitly_convertible
> 2. register_ptr_to_python
> 3. class_::bases
> If none of those has been used, Boost.Python can safely assume that
> the class could not be built from other python types.

Boost.Python also supports custom rvalue converters. See the FAQ for examples.
You'd need two different mechanisms for types that allow custom from_python
conversions (involving the construction and destruction of temporaries) and
those that don't. I am guessing David considered that extra effort not
worthwhile or impractical.

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the Cplusplus-sig mailing list