This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] Document DR 253


Hi,

prompted by the recent fix of libstdc++/3247.

Committing both to mainline and 3_4.

Paolo.

//////////////
2004-03-13  Paolo Carlini  <pcarlini@suse.de>

	* docs/html/ext/howto.html: Add entry for DR 253 [Ready].
	* include/bits/gslice_array.h: Add comment about DR 253.
	* include/bits/indirect_array.h: Likewise.
	* include/bits/mask_array.h: Likewise.
	* include/bits/slice_array.h: Likewise.
diff -urN libstdc++-v3-orig/docs/html/ext/howto.html libstdc++-v3/docs/html/ext/howto.html
--- libstdc++-v3-orig/docs/html/ext/howto.html	2004-03-08 15:51:58.000000000 +0100
+++ libstdc++-v3/docs/html/ext/howto.html	2004-03-13 00:18:50.000000000 +0100
@@ -412,6 +412,14 @@
     <dd>This nested typdef was originally not specified.
     </dd>
 
+    <dt><a href="lwg-active.html#253">253</a>:
+        <em>valarray helper functions are almost entirely useless</em>
+    </dt>
+    <dd>Make the copy constructor and copy-assignment operator declarations
+        public in gslice_array, indirect_array, mask_array, slice_array; provide
+	definitions.
+    </dd>
+
     <dt><a href="lwg-defects.html#265">265</a>:
         <em>std::pair::pair() effects overly restrictive</em>
     </dt>
diff -urN libstdc++-v3-orig/include/bits/gslice_array.h libstdc++-v3/include/bits/gslice_array.h
--- libstdc++-v3-orig/include/bits/gslice_array.h	2004-03-10 10:11:37.000000000 +0100
+++ libstdc++-v3/include/bits/gslice_array.h	2004-03-13 00:23:08.000000000 +0100
@@ -61,11 +61,12 @@
     public:
       typedef _Tp value_type;
 
-      // this constructor needs to be implemented.
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 253. valarray helper functions are almost entirely useless
+
       ///  Copy constructor.  Both slices refer to the same underlying array.
       gslice_array(const gslice_array&);
 
-      // This operator must be public.  See DR-253.
       ///  Assignment operator.  Assigns slice elements to corresponding
       ///  elements of @a a.
       gslice_array& operator=(const gslice_array&);
@@ -134,13 +135,13 @@
     inline
     gslice_array<_Tp>::gslice_array(_Array<_Tp> __a,
 				    const valarray<size_t>& __i)
-      : _M_array(__a), _M_index(__i) {}
+    : _M_array(__a), _M_index(__i) {}
 
 
   template<typename _Tp>
     inline
     gslice_array<_Tp>::gslice_array(const gslice_array<_Tp>& __a)
-      : _M_array(__a._M_array), _M_index(__a._M_index) {}
+    : _M_array(__a._M_array), _M_index(__a._M_index) {}
 
 
   template<typename _Tp>
diff -urN libstdc++-v3-orig/include/bits/indirect_array.h libstdc++-v3/include/bits/indirect_array.h
--- libstdc++-v3-orig/include/bits/indirect_array.h	2004-03-10 10:11:37.000000000 +0100
+++ libstdc++-v3/include/bits/indirect_array.h	2004-03-13 00:23:33.000000000 +0100
@@ -63,11 +63,12 @@
     public:
       typedef _Tp value_type;
 
-      // this constructor needs to be implemented.
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 253. valarray helper functions are almost entirely useless
+
       ///  Copy constructor.  Both slices refer to the same underlying array.
       indirect_array(const indirect_array&);
 
-      // XXX: This is a proposed resolution for DR-253.
       ///  Assignment operator.  Assigns elements to corresponding elements
       ///  of @a a.
       indirect_array& operator=(const indirect_array&);
@@ -139,13 +140,13 @@
   template<typename _Tp>
     inline
     indirect_array<_Tp>::indirect_array(const indirect_array<_Tp>& __a)
-      : _M_sz(__a._M_sz), _M_index(__a._M_index), _M_array(__a._M_array) {}
+    : _M_sz(__a._M_sz), _M_index(__a._M_index), _M_array(__a._M_array) {}
 
   template<typename _Tp>
      inline
      indirect_array<_Tp>::indirect_array(_Array<_Tp> __a, size_t __s,
 					 _Array<size_t> __i)
-       : _M_sz(__s), _M_index(__i), _M_array(__a) {}
+     : _M_sz(__s), _M_index(__i), _M_array(__a) {}
 
   template<typename _Tp>
      inline indirect_array<_Tp>&
diff -urN libstdc++-v3-orig/include/bits/mask_array.h libstdc++-v3/include/bits/mask_array.h
--- libstdc++-v3-orig/include/bits/mask_array.h	2004-03-10 10:11:37.000000000 +0100
+++ libstdc++-v3/include/bits/mask_array.h	2004-03-13 00:24:30.000000000 +0100
@@ -63,11 +63,12 @@
     public:
       typedef _Tp value_type;
 
-      // this constructor needs to be implemented.
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 253. valarray helper functions are almost entirely useless
+
       ///  Copy constructor.  Both slices refer to the same underlying array.
       mask_array (const mask_array&);
       
-      // This operator must be public.  See DR-253.
       ///  Assignment operator.  Assigns elements to corresponding elements
       ///  of @a a.
       mask_array& operator=(const mask_array&);
@@ -136,12 +137,12 @@
 
   template<typename _Tp>
     inline mask_array<_Tp>::mask_array(const mask_array<_Tp>& a)
-      : _M_sz(a._M_sz), _M_mask(a._M_mask), _M_array(a._M_array) {}
+    : _M_sz(a._M_sz), _M_mask(a._M_mask), _M_array(a._M_array) {}
 
   template<typename _Tp>
     inline
     mask_array<_Tp>::mask_array(_Array<_Tp> __a, size_t __s, _Array<bool> __m)
-      : _M_sz(__s), _M_mask(__m), _M_array(__a) {}
+    : _M_sz(__s), _M_mask(__m), _M_array(__a) {}
 
   template<typename _Tp>
     inline mask_array<_Tp>&
diff -urN libstdc++-v3-orig/include/bits/slice_array.h libstdc++-v3/include/bits/slice_array.h
--- libstdc++-v3-orig/include/bits/slice_array.h	2004-02-08 05:46:41.000000000 +0100
+++ libstdc++-v3/include/bits/slice_array.h	2004-03-13 00:24:02.000000000 +0100
@@ -123,11 +123,12 @@
     public:
       typedef _Tp value_type;
 
-      // This constructor is implemented since we need to return a value.
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 253. valarray helper functions are almost entirely useless
+
       ///  Copy constructor.  Both slices refer to the same underlying array.
       slice_array(const slice_array&);
 
-      // This operator must be public.  See DR-253.
       ///  Assignment operator.  Assigns slice elements to corresponding
       ///  elements of @a a.
       slice_array& operator=(const slice_array&);
@@ -196,13 +197,13 @@
   template<typename _Tp>
     inline
     slice_array<_Tp>::slice_array(_Array<_Tp> __a, const slice& __s)
-      : _M_sz(__s.size()), _M_stride(__s.stride()),
-	_M_array(__a.begin() + __s.start()) {}
+    : _M_sz(__s.size()), _M_stride(__s.stride()),
+      _M_array(__a.begin() + __s.start()) {}
 
   template<typename _Tp>
     inline
     slice_array<_Tp>::slice_array(const slice_array<_Tp>& a)
-      : _M_sz(a._M_sz), _M_stride(a._M_stride), _M_array(a._M_array) {}
+    : _M_sz(a._M_sz), _M_stride(a._M_stride), _M_array(a._M_array) {}
 
   //    template<typename _Tp>
   //    inline slice_array<_Tp>::~slice_array () {}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]