It supported feature version of C++ 11 standard. It acquires the contents of right hand side, by move-assigning its members and base classes.
DeclarationFollowing is the declaration for fstream::operator=
C++11copy (1) fstream& operator= (const fstream&) = delete; move (2) fstream& operator= (fstream&& rhs);Parameters
rhs − Another fstream object.
Return ValueIt returns *this.
ExceptionsNo-throw guarantee − this member function never throws exceptions.
Data racesIt modifies both stream objects (*this and rhs).
ExampleIn below example explains about fstream operator= function.
#include <fstream> int main () { std::fstream foo; std::fstream bar ("test.txt"); swap(foo,bar); foo << "tutorialspoint"; foo.close(); return 0; }
fstream.htm
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4