On Wed, Sep 30, 2009 at 6:18 PM, Christopher Bruns <cmbr...@stanford.edu> wrote:
> Single-argument C++ constructors in pyplusplus seem to generate a
> boost::python::implicitly_convertible tag, even when the constructor
> is declared "explicit" in C++.  That doesn't sound right to me.

I don't completely agree with you.

> Shouldn't a pair of types that are not implicitly convertible in C++,
> also not be implicitly convertible in python?

It depends on your use cases.

> I suspect I can manually adjust the implicitly_convertible tag
> generation using the "allow_implicit_conversion" flag in pyplusplus.
> Is there a way to tell pyplusplus to avoid generating an
> implicitly_convertible tag for all explicit constructors?

I don't think so. I attached gccxml generated file for your code. As
you can see both constructors ( Foo and Bar )  have "explitic=1". So
Py++ has no way to find out whether a constructor explicit or not.

If such functionality would present, I think that the default would be
the opposite.

HTH

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/

Attachment: 1.tar.bz
Description: application/bzip

_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to