diff options
author | gdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-12-10 07:32:04 +0000 |
---|---|---|
committer | gdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-12-10 07:32:04 +0000 |
commit | a4348cae815d970dc37e4e0e5a585d9572557eb3 (patch) | |
tree | 57f1f39ffb616fc5492b09c8748c9462cacb74d6 /libstdc++-v3 | |
parent | 0fe26a8677615902a386de4b529da27ec82b6e98 (diff) | |
download | ppe42-gcc-a4348cae815d970dc37e4e0e5a585d9572557eb3.tar.gz ppe42-gcc-a4348cae815d970dc37e4e0e5a585d9572557eb3.zip |
* include/bits/slice_array.h (slice_array<>::operator=): Fix typo.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59983 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 4 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/slice_array.h | 3 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/26_numerics/slice_array_assignment.cc | 16 |
3 files changed, 17 insertions, 6 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 68ca964bad8..1396496d5eb 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,7 @@ +2002-12-09 Gabriel Dos Reis <gdr@integrable-solutions.net> + + * include/bits/slice_array.h (slice_array<>::operator=): Fix typo. + 2002-12-09 Mark Mitchell <mark@codesourcery.com> * libsupc++/cxxabi.h (__cxa_pure_virtual): Declare it. diff --git a/libstdc++-v3/include/bits/slice_array.h b/libstdc++-v3/include/bits/slice_array.h index 1ab351b590c..2502ef4ebee 100644 --- a/libstdc++-v3/include/bits/slice_array.h +++ b/libstdc++-v3/include/bits/slice_array.h @@ -157,7 +157,8 @@ namespace std inline slice_array<_Tp>& slice_array<_Tp>::operator=(const slice_array<_Tp>& __a) { - __valarray_copy(_M_array, _M_sz, _M_stride, __a._M_array, __a._M_stride); + __valarray_copy(__a._M_array, __a._M_sz, __a._M_stride, + _M_array, _M_stride); return *this; } diff --git a/libstdc++-v3/testsuite/26_numerics/slice_array_assignment.cc b/libstdc++-v3/testsuite/26_numerics/slice_array_assignment.cc index f2e20860b6c..52dcfe08336 100644 --- a/libstdc++-v3/testsuite/26_numerics/slice_array_assignment.cc +++ b/libstdc++-v3/testsuite/26_numerics/slice_array_assignment.cc @@ -1,6 +1,6 @@ // 20010613 gdr -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -30,15 +30,21 @@ // This is DR-253. Test for accessible assignment-operators. #include <valarray> +#include <testsuite_hooks.h> int main() { - std::valarray<double> v(10), w(10); - std::slice s(0, 0, 0); + using std::valarray; + using std::slice; + valarray<int> v(1, 10), w(2, 10); - v[s] = w[s]; // dg-do compile + w[slice(0, 3, 3)] = v[slice(2, 3, 3)]; - std::slice_array<double> t = v[s]; + VERIFY(v[0] == 1 && w[0] == 1); + VERIFY(v[3] == 1 && w[3] == 1); + VERIFY(v[6] == 1 && w[6] == 1); + + std::slice_array<int> t = v[slice(0, 10, 1)]; return 0; } |