public member function

<fstream>

std::basic_filebuf::basic_filebuf

default (1)
basic_filebuf();
copy (deleted) (2)
basic_filebuf (const basic_filebuf&) = delete;
move (3)
basic_filebuf (basic_filebuf&& x);

Construct object

Constructs a basic_filebuf object:
(1) default constructor
Constructs a basic_filebuf object. The object is not associated to any file (it is not open).
(2) copy constructor (deleted)
Deleted (no copy constructor).
(3) move constructor
Acquires the contents of x.
x is a closed file stream buffer after the call, with an otherwise unspecified but valid state.
It is unspecified whether the internal sequence is the one in x before the call, or a copy of it. In any case, both objects use independent sequences after the call (if any).

Parameters

x
A basic_filebuf object of the same type (with the same class template parameters charT and traits), whose value is moved.

Data races

The move constructor (3) modifies x.

Exception safety

Strong guarantee: if an exception is thrown, there are no side effects.

See also

basic_filebuf::open
Open file (public member function)
basic_filebuf::is_open
Check if file is open (public member function)