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 DR389


Hi,

I have just applied both to mainline and 3_4 the following doc patch.

Paolo.

//////////////
2004-03-20  Paolo Carlini  <pcarlini@suse.de>
	
	* include/std/std_valarray.h: Document DR389 [Ready].
	* docs/html/ext/howto.html: Add an entry for DR389.
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/docs/html/ext/howto.html,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- gcc/libstdc++-v3/docs/html/ext/howto.html	2004/03/12 23:32:03	1.46
+++ gcc/libstdc++-v3/docs/html/ext/howto.html	2004/03/20 10:05:47	1.47
@@ -479,6 +479,12 @@
     <dd>Change the format string to &quot;%.0Lf&quot;.
     </dd>
 
+    <dt><a href="lwg-active.html#389">389</a>:
+        <em>Const overload of valarray::operator[] returns by value</em>
+    </dt>
+    <dd>Change it to return a <code>const T&amp;</code>.
+    </dd>
+
     <dt><a href="lwg-active.html#402">402</a>:
         <em>Wrong new expression in [some_]allocator::construct</em>
     </dt>
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/std/std_valarray.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- gcc/libstdc++-v3/include/std/std_valarray.h	2004/02/03 04:01:15	1.12
+++ gcc/libstdc++-v3/include/std/std_valarray.h	2004/03/20 10:05:48	1.13
@@ -214,20 +214,17 @@
 	operator= (const _Expr<_Dom,_Tp>&);
 
       // _lib.valarray.access_ element access:
-      // XXX: LWG to be resolved.
       /**
        *  Return a reference to the i'th array element.  
        *
-       *  The C++ spec defines the const version to return Tp instead of
-       *  the more useful const Tp&.  This issue is being reviewed in DR389.
-       *
        *  @param  i  Index of element to return.
        *  @return  Reference to the i'th element.
        */
-      const _Tp&                 operator[](size_t) const;
+      _Tp&                operator[](size_t);
 
-      ///  Return a reference to the i'th array element.
-      _Tp&                operator[](size_t);		
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 389. Const overload of valarray::operator[] returns by value.
+      const _Tp&          operator[](size_t) const;
 
       // _lib.valarray.sub_ subset operations:
       /**


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