Re: [C++-sig] boost.python: private copy constructor problem

2008-12-02 Thread Stefan Seefeld
Mihail Konstantinov wrote: One more question about the syntax. You cited http://www.boost.org/doc/libs/1_37_0/libs/python/doc/v2/class.html#class_-spec which specifies the syntax as "class_" so that I thought I have to include all 4 template arguments. But when I used instead of the above (wor

Re: [C++-sig] boost.python: private copy constructor problem

2008-12-02 Thread Mihail Konstantinov
> try use boost::noncopyable to B or implemente a copy constructor in B > without call A copy contructor. Thank you. This works: BOOST_PYTHON_MODULE(boost_ext) { class_ a("A",init<>()); class_, boost::noncopyable >("B",init<>()); } One more question about the syntax. You cited http://ww

Re: [C++-sig] boost.python: private copy constructor problem

2008-12-02 Thread Stefan Seefeld
Mihail Konstantinov wrote: gcc.compile.c++ bin/gcc-4.1.2/debug/boost.o boost.cpp: In copy constructor ‘B::B(const B&)’: As this error message suggests: as B derives from A, it is (by default) non-copyable, too. That you have to tell python, too, thus: class_ a("A", init<>); class_, nonco

Re: [C++-sig] boost.python: private copy constructor problem

2008-12-02 Thread Roman Yakovenko
On Tue, Dec 2, 2008 at 4:11 PM, Renato Araujo <[EMAIL PROTECTED]> wrote: > try use boost::noncopyable to B or implemente a copy constructor in B > without call A copy contructor. He is right. The following code was generated by Py++: #include "boost/python.hpp" namespace bp = boost::python; BOO

Re: [C++-sig] boost.python: private copy constructor problem

2008-12-02 Thread Marcus Lindblom
Mihail Konstantinov wrote: Stefan Seefeld wrote: In this case you want to tell Python that your object is non-copyable: I followed your suggestion and still get the same error message: [snip] /home/mihail/temporary/boost_1_37_0/boost/python/object/value_holder.hpp: In constructor ‘boost

Re: [C++-sig] boost.python: private copy constructor problem

2008-12-02 Thread Renato Araujo
try use boost::noncopyable to B or implemente a copy constructor in B without call A copy contructor. BR On Tue, Dec 2, 2008 at 11:03 AM, Mihail Konstantinov <[EMAIL PROTECTED]> wrote: >> Stefan Seefeld wrote: > >> >> In this case you want to tell Python that your object is non-copyable: > > I

Re: [C++-sig] boost.python: private copy constructor problem

2008-12-02 Thread Mihail Konstantinov
> Stefan Seefeld wrote: > > In this case you want to tell Python that your object is non-copyable: I followed your suggestion and still get the same error message: boost.cpp:6: error: ‘A::A(const A&)’ is private (full bjam output is appended to this email) Could you check this modified code? bo

Re: [C++-sig] boost.python: private copy constructor problem

2008-12-02 Thread Stefan Seefeld
Mihail Konstantinov wrote: Hello, I am still in the early process of learning boost.python. I have reduced my problem to the following code: #include using namespace boost::python; class A{ private: A(const A&){}; //no public copy constructor }; class B: public A{ public: B(){}; }; BOOST_PY

Re: [C++-sig] boost.python: private copy constructor problem

2008-12-02 Thread Mihail Konstantinov
Sorry, the public A::A() constructor was missing. The corrected class A, which caused the described problem, is: class A{ private: A(const A&){}; //no public copy constructor public: A(){}; }; ___ Cplusplus-sig mailing list Cplusplus-sig@

[C++-sig] boost.python: private copy constructor problem

2008-12-02 Thread Mihail Konstantinov
Hello, I am still in the early process of learning boost.python. I have reduced my problem to the following code: #include using namespace boost::python; class A{ private: A(const A&){}; //no public copy constructor }; class B: public A{ public: B(){}; }; BOOST_PYTHON_MODULE(boost_ext) {