fpos.h (fpos::operator-): Don't return reference, return original, non-modified version.
authorBenjamin Kosnik <bkoz@redhat.com>
Wed, 13 Jun 2001 01:14:42 +0000 (01:14 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Wed, 13 Jun 2001 01:14:42 +0000 (01:14 +0000)
2001-06-12  Benjamin Kosnik  <bkoz@redhat.com>

* include/bits/fpos.h (fpos::operator-): Don't return reference,
return original, non-modified version.
(fpos::operator+): Same.

From-SVN: r43287

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/fpos.h

index 5f3e3d7be81feb6bb09213ccf08090a8873472fb..ddc78e701d3cc2c14415b759fb7b2870aa0b7464 100644 (file)
@@ -1,3 +1,9 @@
+2001-06-12  Benjamin Kosnik  <bkoz@redhat.com>
+
+       * include/bits/fpos.h (fpos::operator-): Don't return reference,
+       return original, non-modified version.
+       (fpos::operator+): Same.
+
 2001-06-12  Loren J. Rittle  <ljrittle@acm.org>
 
        libstdc++/2071
@@ -32,7 +38,7 @@
        * config/os/solaris/solaris2.7/bits/os_defines.h
        (_GLIBCPP_AVOID_FSEEK): Likewise.
 
-2001-06-12   Benjamin Kosnik  <bkoz@redhat.com>
+2001-06-12  Benjamin Kosnik  <bkoz@redhat.com>
 
        * acinclude.m4 (GLIBCPP_CHECK_COMPILER_VERSION): Change to
        AC_TRY_COMPILE, so that the built compiler is checked, and
index 7f43f9d36ab3ad1a9afbf9a30e58014c2c9d10ce..86eb5c38e4915cec3773d0d1014a57f4f2640ef7 100644 (file)
@@ -52,8 +52,8 @@ namespace std
       typedef _StateT __state_type;
 
     private:
-      __state_type     _M_st;
       streamoff        _M_off;
+      __state_type     _M_st;
 
     public:
       __state_type
@@ -64,10 +64,10 @@ namespace std
 
       // NB: The standard defines only the implicit copy ctor and the
       // previous two members.  The rest is a "conforming extension".
-      fpos(): _M_st(__state_type()), _M_off(streamoff()) { }
+      fpos(): _M_off(streamoff()), _M_st(__state_type()) { }
 
       fpos(streamoff __off, __state_type __st = __state_type())
-      : _M_st(__st), _M_off(__off) { }
+      :  _M_off(__off), _M_st(__st) { }
 
       operator streamoff() const { return _M_off; }
 
@@ -77,18 +77,20 @@ namespace std
       fpos& 
       operator-=(streamoff __off) { _M_off -= __off; return *this; }
 
-      fpos& 
+      fpos 
       operator+(streamoff __off) 
       { 
-       fpos t(*this); 
-       return t += __off; 
+       fpos __t(*this); 
+       __t += __off;
+       return __t;
       }
 
-      fpos&      
+      fpos      
       operator-(streamoff __off) 
       { 
-       fpos t(*this); 
-       return t -= __off; 
+       fpos __t(*this); 
+       __t -= __off; 
+       return __t;
       }
 
       bool