mail[Wesnoth-commits] r20033 - in /trunk/src: filesystem.cpp filesystem.hpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by david on September 01, 2007 - 18:05:
Author: torangan
Date: Sat Sep  1 18:05:00 2007
New Revision: 20033

URL: http://svn.gna.org/viewcvs/wesnoth?rev=20033&view=rev
Log:
give standard semantics to operator=

Modified:
    trunk/src/filesystem.cpp
    trunk/src/filesystem.hpp

Modified: trunk/src/filesystem.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/filesystem.cpp?rev=20033&r1=20032&r2=20033&view=diff
==============================================================================
--- trunk/src/filesystem.cpp (original)
+++ trunk/src/filesystem.cpp Sat Sep  1 18:05:00 2007
@@ -1049,10 +1049,11 @@
        return "";
 }
 
-void scoped_istream::operator=(std::istream *s)
+scoped_istream& scoped_istream::operator=(std::istream *s)
 {
        delete stream;
        stream = s;
+       return *this;
 }
 
 scoped_istream::~scoped_istream()
@@ -1060,10 +1061,11 @@
        delete stream;
 }
 
-void scoped_ostream::operator=(std::ostream *s)
+scoped_ostream& scoped_ostream::operator=(std::ostream *s)
 {
        delete stream;
        stream = s;
+       return *this;
 }
 
 scoped_ostream::~scoped_ostream()

Modified: trunk/src/filesystem.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/filesystem.hpp?rev=20033&r1=20032&r2=20033&view=diff
==============================================================================
--- trunk/src/filesystem.hpp (original)
+++ trunk/src/filesystem.hpp Sat Sep  1 18:05:00 2007
@@ -149,7 +149,7 @@
        std::istream *stream;
 public:
        scoped_istream(std::istream *s): stream(s) {}
-       void operator=(std::istream *);
+       scoped_istream& operator=(std::istream *);
        std::istream &operator*() { return *stream; }
        std::istream *operator->() { return stream; }
        ~scoped_istream();
@@ -159,7 +159,7 @@
        std::ostream *stream;
 public:
        scoped_ostream(std::ostream *s): stream(s) {}
-       void operator=(std::ostream *);
+       scoped_ostream& operator=(std::ostream *);
        std::ostream &operator*() { return *stream; }
        std::ostream *operator->() { return stream; }
        ~scoped_ostream();




Related Messages


Powered by MHonArc, Updated Sat Sep 01 18:20:12 2007