octave-maintainers
[Top][All Lists]
Advanced

[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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]