[C++-sig] Implicit constructors?

David Abrahams dave at boost-consulting.com
Fri Jul 26 04:52:05 CEST 2002


I think if you def() the copy constructor it should work automatically
(though it could be more efficient). Does that help?

           ---------------------------------
           David Abrahams * Boost Consulting
dave at boost-consulting.com * http://www.boost-consulting.com


----- Original Message -----
From: "Ralf W. Grosse-Kunstleve" <rwgk at yahoo.com>
To: <c++-sig at python.org>
Sent: Thursday, July 25, 2002 9:41 PM
Subject: [C++-sig] Implicit constructors?


> The register_container_from_python_sequence in the bpl_utils enables
implicit
> conversion from Python sequences to container types such as std::vector<>
when
> function signatures are matched. Now say I've actually exposed
> std::vector<double> with class_<> as std_vector in Python. Now I'd like
this to
> work:
>
> from arrays import std_vector_double
> v=std_vector_double((1,2,3))
>
> Given that the corresponding register_container_from_python_sequence is
in the
> registry, could this be made to work (or will this work) without
explicitly
> def()'ing a constructor that takes a tuple?
>
> Thanks,
> Ralf
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - Feel better, live better
> http://health.yahoo.com
>
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig





More information about the Cplusplus-sig mailing list