Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-07-30 08:07:40


Vesselin,

This is a VC6 bug, since it's complaining about the lack of a default
constructor for a class which clearly does have one. It is not complaining
about the lack of a default constructor in /your/ class, though adding one
seems to silence the complaint.

The following compiles without error on GCC, but not on MSVC:

----- Original Message -----
From: <VesselinPeev_at_[hidden]>
To: <boost_at_[hidden]>
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 I
> 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 precisely
> same error will pop up.
>
> BTW I've tested the examples getting_started1 and getting_started2,
> and they run without problems.
> I've also noticed that none of the constructor(s) of the derived class
> (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:
<mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk