[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Compilation error: auto_ptr and private class
From: |
Jaroslav Hajek |
Subject: |
Re: Compilation error: auto_ptr and private class |
Date: |
Sat, 13 Feb 2010 05:24:24 +0100 |
On Fri, Feb 12, 2010 at 11:41 PM, Michael Goffioul
<address@hidden> wrote:
> On Fri, Feb 12, 2010 at 6:06 PM, Jaroslav Hajek <address@hidden> wrote:
>> I'd suggest you start with the Octave sources instead and keep
>> removing stuff up to the smallest failing skeleton.
>
> I could narrow the problem down to the presence of
> overloaded new/delete operators. The attached sample
> code reproduces the same compilation error.
>
> Michael.
>
Nice, I overlooked this. Still it's a bug, IMHO, because the operators
are public.
So I suppose just removing the OCTAVE_ALLOCATOR decls and defines
should work for you.
Another option is to use idx_vector instead of auto_ptr to hold the
pointer - this should also prevent a leak. But idx_vector has no
release() so you'll need to explicitly increment the counter prior to
returning, and it does not have the -> operator overload, so you'll
need to reference the rep member. I see auto_ptr was really the best
tool here.
regards
--
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz
- Re: Compilation error: auto_ptr and private class, (continued)
- Re: Compilation error: auto_ptr and private class, Jaroslav Hajek, 2010/02/12
- Re: Compilation error: auto_ptr and private class, Michael Goffioul, 2010/02/12
- Re: Compilation error: auto_ptr and private class, John Swensen, 2010/02/12
- Re: Compilation error: auto_ptr and private class, Michael Goffioul, 2010/02/12
- Re: Compilation error: auto_ptr and private class, John Swensen, 2010/02/12
- Message not available
- Re: Compilation error: auto_ptr and private class, Michael Goffioul, 2010/02/12
- Re: Compilation error: auto_ptr and private class, John Swensen, 2010/02/12
- Re: Compilation error: auto_ptr and private class, Jaroslav Hajek, 2010/02/12
- Re: Compilation error: auto_ptr and private class, Michael Goffioul, 2010/02/12
- Re: Compilation error: auto_ptr and private class, Michael Goffioul, 2010/02/12
- Re: Compilation error: auto_ptr and private class,
Jaroslav Hajek <=
- Re: Compilation error: auto_ptr and private class, Michael Goffioul, 2010/02/13
Re: Compilation error: auto_ptr and private class, Jordi GutiƩrrez Hermoso, 2010/02/12