Date: 2001-07-30 08:29:14
Your previous post seems unfinished.
Okay, it crossed my mind that's a bug, but how can I make the Python
script call the right constructor? That's my problem. I want the
constructor with arguments to get called, whereas the default gets
called. And I do want to use VC -- I hope there's a solution -- this
is such a trivial usage of class inheritance.
I'll add the default constructor anyway, and adding it in the
protected section seems to do the job, too.
I'm really sorry for bothering you.
--- In boost_at_y..., "David Abrahams" <david.abrahams_at_r...> wrote:
> This is a VC6 bug, since it's complaining about the lack of a
> constructor for a class which clearly does have one. It is not
> about the lack of a default constructor in /your/ class, though
> seems to silence the complaint.
> The following compiles without error on GCC, but not on MSVC:
> ----- Original Message -----
> From: <VesselinPeev_at_o...>
> To: <boost_at_y...>
> Sent: Monday, July 30, 2001 3:38 AM
> Subject: [boost] Re: Wrong constructor invoked in Boost.Python
> > So...
> > Uncommenting only the declaration and definition of the default
> > constructor without arguments in both class A and B in the source
> > gave in my previous post, you should get:
> > c:\boost_1_23_0\boost/python/reference.hpp(53) : error C2512:
> > 'py_ptr_conversions<class boost::python::reference<struct
> > _object>,struct _object,struct boost::dereferenceable<class
> > boost::python::reference<struct _object>,struct _object *,class bo
> > ost::detail::empty_base> >' : no appropriate default constructor
> > available
> > c:\boost_1_23_0\boost/python/reference.hpp(51) : while
> > compiling class-template member function '__thiscall
> > boost::python::reference<struct
> > _object>::boost::python::reference<struct _object>(const class
> > boost::python::reference<struct _object> &)'
> > Error executing cl.exe.
> > QS.obj - 1 error(s), 0 warning(s)
> > Note that you need to do the above for both classes, or the
> > same error will pop up.
> > BTW I've tested the examples getting_started1 and
> > and they run without problems.
> > I've also noticed that none of the constructor(s) of the derived
> > (es) in them call the base class' constructor. So this seems the
> > cause, but I don't know how to fix it.
> > Thanks in advance once again.
> > --- In boost_at_y..., "David Abrahams" <david.abrahams_at_r...> wrote:
> > >
> > > ----- Original Message -----
> > > From: <VesselinPeev_at_o...>
> > > >
> > > > Why is this happening? I am also forced to define the default
> > > > constructors without arguments, othewise I get compile errors.
> > >
> > > What compile errors do you get?
> > Info: http://www.boost.org Unsubscribe:
> > Your use of Yahoo! Groups is subject to
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk