From: Jan Nieuwenhuizen <janneke@gnu.org> Date: Thu, 2 Feb 2006 16:24:27 +0000 (+0000) Subject: * flower/include/std-vector.hh X-Git-Tag: release/2.7.31~13 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=86fac535aef982d4f98f9f51e7476ab84b28c247;p=lilypond.git * flower/include/std-vector.hh * flower/include/array.hh (reverse, swap): Detach from class. Update users. * flower/include/std-vector.hh * flower/include/array.hh (concat): Globally change to insert (). * flower/include/std-vector.hh * flower/include/parray.hh * flower/include/array.hh (elem, elem_ref): Globally replace by at (). --- diff --git a/ChangeLog b/ChangeLog index 76ed56b991..f49951e374 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2006-02-02 Jan Nieuwenhuizen <janneke@gnu.org> + * flower/include/std-vector.hh (boundary): Oops, reverse. + * flower/string-convert.cc (convert::unsigned_string): Bugfix: remove superfluous `d'. diff --git a/flower/include/array.hh b/flower/include/array.hh index 98e4d1f060..c8110b1790 100644 --- a/flower/include/array.hh +++ b/flower/include/array.hh @@ -309,7 +309,7 @@ public: boundary (Array<T> const &v, int dir, vsize i) { assert (dir); - return v[dir == 1 ? i : v.size () - 1 - i]; + return v[dir = -1 ? i : v.size () - 1 - i]; } template<typename T> @@ -317,7 +317,7 @@ public: boundary (Array<T> &v, int dir, vsize i) { assert (dir); - return v[dir == 1 ? i : v.size () - 1 - i]; + return v[dir == -1 ? i : v.size () - 1 - i]; } template<class T> diff --git a/flower/include/std-vector.hh b/flower/include/std-vector.hh index 10018dc1e7..3386ac74b8 100644 --- a/flower/include/std-vector.hh +++ b/flower/include/std-vector.hh @@ -38,7 +38,7 @@ namespace std { boundary (vector<T> const &v, int dir, vsize i) { assert (dir); - return v[dir == 1 ? i : v.size () - 1 - i]; + return v[dir == -1 ? i : v.size () - 1 - i]; } template<typename T> @@ -46,7 +46,7 @@ namespace std { boundary (vector<T> &v, int dir, vsize i) { assert (dir); - return v[dir == 1 ? i : v.size () - 1 - i]; + return v[dir == -1 ? i : v.size () - 1 - i]; } template<typename T> diff --git a/flower/test-std.cc b/flower/test-std.cc index 72e86f110a..7e7acee091 100644 --- a/flower/test-std.cc +++ b/flower/test-std.cc @@ -114,7 +114,11 @@ BOOST_AUTO_UNIT_TEST (vector_insert) BOOST_AUTO_UNIT_TEST (parray_concat) { +#if 1 Link_array<int> u, v; +#else + vector<int*> u, v; +#endif int a[5] = { 0, 1, 2, 3, 4 }; u.push_back (&a[0]); u.push_back (&a[1]);