# HG changeset patch # User jwe # Date 1064081320 0 # Node ID 382cb0ed8c14f92dc04c03b0264aa7c765ca2e66 # Parent b4449b1193ac06c8d07078fcd29f420b4dcc8c91 [project @ 2003-09-20 18:08:40 by jwe] diff -r b4449b1193ac -r 382cb0ed8c14 liboctave/Array.cc --- a/liboctave/Array.cc Sat Sep 20 02:06:07 2003 +0000 +++ b/liboctave/Array.cc Sat Sep 20 18:08:40 2003 +0000 @@ -30,6 +30,7 @@ #endif #include +#include #include diff -r b4449b1193ac -r 382cb0ed8c14 liboctave/Array.h --- a/liboctave/Array.h Sat Sep 20 02:06:07 2003 +0000 +++ b/liboctave/Array.h Sat Sep 20 18:08:40 2003 +0000 @@ -135,8 +135,16 @@ typename Array::ArrayRep *rep; +public: + + // !!! WARNING !!! -- this is public because template friends don't + // work properly with versions of gcc earlier than 3.3. You should + // not access this data member directly! + dim_vector dimensions; +protected: + idx_vector *idx; int idx_count; @@ -394,7 +402,13 @@ T operator () (const Array& ra_idx) const { return elem (ra_idx); } #endif -protected: + // !!! WARNING !!! -- the following resize_no_fill and + // resize_and_fill functions are public because template friends + // don't work properly with versions of gcc earlier than 3.3. You + // should use these functions only in classes that are derived + // from Array. + + // protected: void resize_no_fill (int n); @@ -489,25 +503,29 @@ // static T resize_fill_value (void) { return T (); } - template - friend int - assign (Array& lhs, const Array& rhs, const LT& rfv); - - template - friend int - assign1 (Array& lhs, const Array& rhs, const LT& rfv); - - template - friend int - assign2 (Array& lhs, const Array& rhs, const LT& rfv); - - template - friend int - assignN (Array& lhs, const Array& rhs, const LT& rfv); - void print_info (std::ostream& os, const std::string& prefix) const; }; +// NOTE: these functions should be friends of the Array class and +// Array::dimensions should be protected, not public, but we can't +// do that because of bugs in gcc prior to 3.3. + +template +/* friend */ int +assign (Array& lhs, const Array& rhs, const LT& rfv); + +template +/* friend */ int +assign1 (Array& lhs, const Array& rhs, const LT& rfv); + +template +/* friend */ int +assign2 (Array& lhs, const Array& rhs, const LT& rfv); + +template +/* friend */ int +assignN (Array& lhs, const Array& rhs, const LT& rfv); + template int assign (Array& lhs, const Array& rhs) diff -r b4449b1193ac -r 382cb0ed8c14 liboctave/ChangeLog --- a/liboctave/ChangeLog Sat Sep 20 02:06:07 2003 +0000 +++ b/liboctave/ChangeLog Sat Sep 20 18:08:40 2003 +0000 @@ -1,3 +1,22 @@ +2003-09-20 John W. Eaton + + * Array.h (dimensions): Now public. + template + (assign (Array&, const Array&, const LT&), + assign1 (Array&, const Array&, const LT&), + assign2 (Array&, const Array&, const LT&), + assignN (Array&, const Array&, const LT&), + resize_no_fill (int), + resize_no_fill (int, int), + resize_no_fill (int, int, int), + resize_no_fill (const dim_vector&), + resize_and_fill (int, const T&), + resize_and_fill (int, int, const T&), + resize_and_fill (int, int, int, const T&), + resize_and_fill (const dim_vector&, const T&)): Now public. + + * Array.cc: Include . + 2003-09-19 John W. Eaton * Array.cc: Merge Array-idx.h.