Re: [C++-sig] help on abstract class export

2011-04-29 Thread Jakub Zytka
On 04/29/11 09:14, zeb wrote: mb.free_fun('createWorker').call_policies = call_policies.return_value_policy(call_policies.return_pointee_value) you do not want to have *value* of an abstract class. I found that if the IWorker class is not abstract, for example: class IWorker { public:

Re: [C++-sig] TypeError: No to_python (by-value) converter found for C++ type: class std::basic_ostream >

2010-09-29 Thread Jakub Zytka
On 09/29/10 14:11, Simon W wrote: Thank you for the answer. Is there any way I can prevent it from copying the stream object even though std::ostream::write() returns a std::ostream& ? You can use other return policy, or define one on your own. http://www.boost.org/doc/libs/1_44_0/libs/python/d

Re: [C++-sig] TypeError: No to_python (by-value) converter found for C++ type: class std::basic_ostream >

2010-09-29 Thread Jakub Zytka
> I get this error: > *TypeError: No to_python (by-value) converter found for C++ type: class > std::basic_ostream >* > > This is the python function > *def serialise(self, gameobj, file): > if(gameobj in self.components): > file.write("HEY", 3)* > > What's the problem h

Re: [C++-sig] gtkglext & mesa = __cxa_allocate_exception

2010-09-15 Thread Jakub Zytka
On 09/14/10 21:18, Leonard Ritter wrote: On Tue, Sep 14, 2010 at 9:12 PM, Leonard Ritter wrote: it seems that when gtk.glext is imported in python, and a boost python module hits a StopIteration exception (as it is usual for generators), the exception is not caught and the app segfaults. that

Re: [C++-sig] pyplusplus bug related to boost::equality_comparable (and possibly other operators as well)

2010-09-10 Thread Jakub Zytka
On 09/09/10 20:08, Roman Yakovenko wrote: I don't think fixing py++ is the right approach. I'm also considering a workaround of checking bases for all the classes and add missing "self != self" for all those which derive from equality_comparable; Perhaps there is the same problem with less_tha

[C++-sig] pyplusplus bug related to boost::equality_comparable (and possibly other operators as well)

2010-09-09 Thread Jakub Zytka
Actually, I haven't had time to investigate it deeper yet, but it seems to be a pyplusplus's bug. I also haven't found anything relevant on the net, so here we go: Test case: class to be exposed (file a.h) #include class A: boost::equality_comparable { public: A(int a): a(a) {};

Re: [C++-sig] problem with boost::python and pickling

2010-07-02 Thread Jakub Zytka
On 07/02/10 15:42, Jakub Zytka wrote: Ok, on newer boost (1.43) error message pointed the actual problem: even for such simple dummy class some pickling support must be provided, eg. struct dummy_pickle_suite : boost::python::pickle_suite { static boost::python::tuple getinitargs(const

[C++-sig] problem with boost::python and pickling

2010-07-02 Thread Jakub Zytka
I've run into some problem i do not understand. Consider following example, which is a slightly modified pickle2.cpp from boost's libs/python/test/: #include #include #include #include #include namespace boost_python_test { struct dummy // my addition { }; // A friendly class. class w