Re: [C++-sig] No to_python (by-value) converter found for C++ type

2010-05-24 Thread abhi.sri45
Hi, >mb = module_builder_t( ... ) >mb.class_(...).noncopyable = False This does not works in my case. Example code is: enum CallStatus { SUCCESS = 423, FAILURE = 764 }; template struct CallResult { public: CallResult(CallStatus const callStatus) : status(callSt

Re: [C++-sig] No to_python (by-value) converter found for C++ type

2010-05-24 Thread vishal bayskar
>It seems, that py++ was wrong :-(. Can you specify gccxml version, OS >and your compiler? Do you mind to submit a small test case that >reproduce the problem? gccxml: gccxml-0.9 OS: x86_64-redhat-linux Compiler: gcc version 4.1.2 20080704 (Red Hat 4.1.2-44) You can use the code attached below

Re: [C++-sig] No to_python (by-value) converter found for C++ type

2010-05-24 Thread Roman Yakovenko
On Tue, May 25, 2010 at 9:06 AM, vishal bayskar wrote: > > >>Did you try to remove "noncopyable" from the generated code? If so >>what happened? > > Thanks, yes it works when "noncopyable" is removed. > >>If you think, that py++ wrong, you can always override its decision: > >>mb = module_builder_

Re: [C++-sig] No to_python (by-value) converter found for C++ type

2010-05-24 Thread vishal bayskar
>Did you try to remove "noncopyable" from the generated code? If so >what happened? Thanks, yes it works when "noncopyable" is removed. >If you think, that py++ wrong, you can always override its decision: >mb = module_builder_t( ... ) >mb.class_(...).noncopyable = False Thanks again it is he

Re: [C++-sig] No to_python (by-value) converter found for C++ type

2010-05-24 Thread vishal bayskar
>I suspect it would do so if you don't have a public copy constructor defined available, even if you didn't use boost::noncopyable to get rid of it. Thanks Jim, I have defined public copy constructor explicitly now it is working. ___ Cplusplus-sig

Re: [C++-sig] No to_python (by-value) converter found for C++ type

2010-05-24 Thread Roman Yakovenko
On Tue, May 25, 2010 at 8:46 AM, vishal bayskar wrote: > > >>I didn't see anything attached to your email, and my tar doesn't like >>what's at the link above.  I'm not sure whatever binding generator >>you're using (Py++?) uses to determine whether to thrown noncopyable in, >>there, but I suspect

Re: [C++-sig] No to_python (by-value) converter found for C++ type

2010-05-24 Thread vishal bayskar
>I didn't see anything attached to your email, and my tar doesn't like >what's at the link above. I'm not sure whatever binding generator >you're using (Py++?) uses to determine whether to thrown noncopyable in, >there, but I suspect it would do so if you don't have a public copy >constructo

Re: [C++-sig] No to_python (by-value) converter found for C++ type

2010-05-24 Thread Jim Bosch
On 05/24/2010 09:03 PM, vishal bayskar wrote: After some analysis I found, in my case python bindings generated contains line: typedef bp::class_< CallResult< Simple>, boost::noncopyable> CallResult_less__Simple__greater__exposer_t; I could not understand why boost::noncopyable is added as an e

[C++-sig] No to_python (by-value) converter found for C++ type

2010-05-24 Thread vishal bayskar
I am facing a problem while creating python binding for some code in my application. I have created a sample program for that and attached the same to this mail. Here after the generation of python bindings when I try to use that it fails with error No to_python (by-value) converter found for C+

Re: [C++-sig] automatic conversion of tuple to vector

2010-05-24 Thread Jim Bosch
On 05/24/2010 03:00 PM, Nathan Cournia wrote: Basically, the desired behavior is to have a C++ function which accepts a vector in C++; accept a tuple/list when in Python. I'm not sure if the FAQ is up-to-date. Is this still not possible in boost.python? How do people generally get the behavio

[C++-sig] automatic conversion of tuple to vector

2010-05-24 Thread Nathan Cournia
Hi All, The FAQ at: http://www.boost.org/doc/libs/1_43_0/libs/python/doc/v2/faq.html lists the following code as not possible with boost.python: C++: void foo(std::vector& array) { for(std::size_t i=0;i>> l = [1, 2, 3] >>> foo(l) >>> print l [2, 4, 6] Basically, the desired behavior is to

Re: [C++-sig] How to wrap reference to abstract base class to get C++ polymorphism

2010-05-24 Thread Nicolas Colombe
2010/5/20 Kun Hong > > > class B > { > public: >virtual const char *getName() const = 0; > }; > > BOOST_PYTHON_MODULE(Test) > { > >class_ >("B", no_init) >.def("getName", pure_virtual(&B::getName)) >; > >def("getB", &getB, > return_value