|
From: Ioannis V. <no...@ho...> - 2002-06-20 22:52:07
|
> -----Original Message-----
> From: Ioannis Vranos [mailto:no...@ho...]
> Sent: Friday, June 21, 2002 1:48 AM
> To: 'Min...@li...'
> Subject: RE: [Mingw-users] I'm trying to port some code from
> VC++ to Mingw
>
>
> > -----Original Message-----
> > From: Garrett Serack [mailto:gs...@ex...]
> > Sent: Friday, June 21, 2002 12:36 AM
> > To: Min...@li...
> > Cc: Ioannis Vranos
> > Subject: Re: [Mingw-users] I'm trying to port some code from
> > VC++ to Mingw
> >
> > Oh I completely understand. Were this starting from
> scratch, I would
> > tend to do things a quite a bit different.I think I've missed
> > explaining
> > some of the stuff around it.
> >
> > There is an extremely large codebase on Visual C++ that works
> > quite fine
> > here. I'm hoping to port it across to GCC on Windows first,
> and then
> > possilby onto Linux once it's functioning nicely there.
> >
> > This existing codebase predates the STL by a smidgen. Heck,
> a rather
> > large portion predates 32 bit Windows. The core code runs on
> > OS/2(!!!)
> > and Windows, and still cross complies between the two.
> >
> > Whilst I could go around fixing up thse types of operations,
> > it would be
> > much more convenient if GCC would bend a little. Both the
> > MSVC++(6 and
> > 7) don't have any trouble with the existing code, and VisualAge C++
> > compiles it just fine too. Although I haven't checked, rumor
> > has it that
> > it compiles fine under Watcom too :)
> >
> > I'll try it out on the Intel compiler next, and see what
> that's doing.
>
>
> Well it is a good thing the compiler asks you what you mean.
> The code is indeed an error because of ambiguity. I find it
> strange it compiles anywhere.
>
>
> Try to solve the ambiguities by direct calls to the constructors.
Ok i found what the real problem is.
The copy constructor is ptr( &ptr). But this is not good for
temporaries. A reference to a temporary is illegal. However temporaries
can be pointed by const references.
So make the constructor:
ptr( const ptr& a )
{
_p = a._p;
}
and everything will be happy.
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.cjb.net
* Alternative URL: http://run.to/noicys
|