[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: rc/ov.h:166: warning: 'octave_value::rep' should be initialized in t
From: |
John W. Eaton |
Subject: |
Re: rc/ov.h:166: warning: 'octave_value::rep' should be initialized in the member initialization list |
Date: |
Fri, 14 Jan 2011 14:41:25 -0500 |
On 14-Jan-2011, Jordi Gutiérrez Hermoso wrote:
| 2011/1/14 Jordi Gutiérrez Hermoso <address@hidden>:
| > On 14 January 2011 13:14, John W. Eaton <address@hidden> wrote:
| >> Note that the octave_base_value constructor sets the count to 1, so by
| >> incrementing it here, we ensure that this object can never be deleted,
| >> so it should be safe to use the static member instead of allocating it
| >> with new.
| >
| > It's never safe to use delete without new.
|
| Er, right, read that too quickly, delete is never called. We could
| just erase that line...?
No. It is never called for the "nil_rep" object. But it is
called for all the other types of objects derived from
octave_base_value that can be assigned to an octave_value::rep
pointer.
jwe
Re: rc/ov.h:166: warning: 'octave_value::rep' should be initialized in the member initialization list, Jaroslav Hajek, 2011/01/17