Mercurial > hg > octave-lyh
changeset 4979:ce4e3d39d05b
[project @ 2004-09-08 23:25:05 by jwe]
author | jwe |
---|---|
date | Wed, 08 Sep 2004 23:25:05 +0000 |
parents | 8719102eb804 |
children | 003bbf6c13d8 |
files | liboctave/Array.h liboctave/ChangeLog liboctave/idx-vector.h |
diffstat | 3 files changed, 21 insertions(+), 61 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/Array.h +++ b/liboctave/Array.h @@ -224,7 +224,7 @@ Array (const Array<T>& a, const dim_vector& dv); - ~Array (void); + virtual ~Array (void); Array<T>& operator = (const Array<T>& a) {
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,11 @@ +2004-09-08 John W. Eaton <jwe@octave.org> + + * Array.h (Array::~Array): Declare virtual. + + * idx-vector.h (idx_vector::idx_vector): Initialize rep in member + initializaion list. Don't set rep->count since the rep + constructor does that. + 2004-09-07 John W. Eaton <jwe@octave.org> * data-conv.cc (oct_data_conv::string_to_data_type): Handle dt_logical.
--- a/liboctave/idx-vector.h +++ b/liboctave/idx-vector.h @@ -191,79 +191,31 @@ public: - idx_vector (void) - { - rep = new idx_vector_rep (); - rep->count = 1; - } + idx_vector (void) : rep (new idx_vector_rep ()) { } - idx_vector (const ColumnVector& v) - { - rep = new idx_vector_rep (v); - rep->count = 1; - } + idx_vector (const ColumnVector& v) : rep (new idx_vector_rep (v)) { } - idx_vector (const NDArray& nda) - { - rep = new idx_vector_rep (nda); - rep->count = 1; - } + idx_vector (const NDArray& nda) : rep (new idx_vector_rep (nda)) { } template <class U> - idx_vector (const intNDArray<U>& inda) - { - rep = new idx_vector_rep (inda); - rep->count = 1; - } + idx_vector (const intNDArray<U>& inda) : rep (new idx_vector_rep (inda)) { } - idx_vector (const Range& r) - { - rep = new idx_vector_rep (r); - rep->count = 1; - } + idx_vector (const Range& r) : rep (new idx_vector_rep (r)) { } - idx_vector (double d) - { - rep = new idx_vector_rep (d); - rep->count = 1; - } + idx_vector (double d) : rep (new idx_vector_rep (d)) { } - idx_vector (int i) - { - rep = new idx_vector_rep (i); - rep->count = 1; - } + idx_vector (int i) : rep (new idx_vector_rep (i)) { } - idx_vector (char c) - { - rep = new idx_vector_rep (c); - rep->count = 1; - } + idx_vector (char c) : rep (new idx_vector_rep (c)) { } - idx_vector (bool b) - { - rep = new idx_vector_rep (b); - rep->count = 1; - } + idx_vector (bool b) : rep (new idx_vector_rep (b)) { } template <class U> - idx_vector (const octave_int<U>& i) - { - rep = new idx_vector_rep (i); - rep->count = 1; - } + idx_vector (const octave_int<U>& i) : rep (new idx_vector_rep (i)) { } - idx_vector (const boolNDArray& bnda) - { - rep = new idx_vector_rep (bnda); - rep->count = 1; - } + idx_vector (const boolNDArray& bnda) : rep (new idx_vector_rep (bnda)) { } - idx_vector (const idx_vector& a) - { - rep = a.rep; - rep->count++; - } + idx_vector (const idx_vector& a) : rep (a.rep) { rep->count++; } ~idx_vector (void) {