]> gcc.gnu.org Git - gcc.git/commitdiff
* include/bits/slice_array.h (slice_array<>::operator=): Fix typo.
authorGabriel Dos Reis <gdr@integrable-solutions.net>
Tue, 10 Dec 2002 07:32:04 +0000 (07:32 +0000)
committerGabriel Dos Reis <gdr@gcc.gnu.org>
Tue, 10 Dec 2002 07:32:04 +0000 (07:32 +0000)
From-SVN: r59983

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/slice_array.h
libstdc++-v3/testsuite/26_numerics/slice_array_assignment.cc

index 68ca964bad82b893a9402783fb07e3d4a86f3868..1396496d5ebbdeeed066fc97856ccf0179568f28 100644 (file)
@@ -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.
index 1ab351b590c1505551fe8d81592b46c6a03d274e..2502ef4ebee925903da37b21fcf9f972da2f10d0 100644 (file)
@@ -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;
     }
 
index f2e20860b6c361e04cbbf5412479623c47fc2768..52dcfe08336002c8fee86e6741a1196d901980b9 100644 (file)
@@ -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
 
 // 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;
 }
This page took 0.07714 seconds and 5 git commands to generate.