Espacios de nombres
Variantes

std::basic_filebuf::operator=

De cppreference.com
 
 
Biblioteca de E/S
Manipuladores de E/S
E/S estilo C
Búferes
(en desuso en C++98)
Flujos
Abstracciones
E/S de archivos
E/S de cadenas
E/S de arrays
(en desuso en C++98)
(en desuso en C++98)
(en desuso en C++98)
Salida sincronizada
Tipos
Interfaz de categoría de error
(C++11)
 
std::basic_filebuf
Las funciones públicas miembros
Original:
Public member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Protegido funciones miembro
Original:
Protected member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Terceros funciones
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
<tbody> </tbody>
std::basic_filebuf& operator=( std::basic_filebuf&& rhs );
(desde C++11)
std::basic_filebuf& operator=( const std::basic_filebuf& rhs ) = delete;

1)

En primer lugar llama close() para cerrar el archivo asociado, entonces se mueve el contenido de rhs en *this: el put y get buffers, el archivo asociado, la configuración regional, el openmode, la bandera is_open, y cualquier otro estado. Después del movimiento, rhs no está asociado con un archivo y rhs.is_open() == false .
Original:
First calls close() to close the associated file, then moves the contents of rhs into *this: the put and get buffers, the associated file, the locale, the openmode, the is_open flag, and any other state. After the move, rhs is not associated with a file and rhs.is_open() == false.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

2)

El operador de asignación de copia se suprime basic_filebuf no es CopyAssignable .
Original:
The copy assignment operator is deleted; basic_filebuf is not CopyAssignable.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Parámetros

rhs -
otro basic_filebuf que se moverá desde
Original:
another basic_filebuf that will be moved from
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Valor de retorno

*this

Ejemplo

#include <fstream>
#include <string>
#include <iostream>

int main()
{

    std::ifstream fin("test.in"); // read-only
    std::ofstream fout("test.out"); // write-only

    std::string s;
    getline(fin, s);
    std::cout << s << '\n'; // output

    *fin.rdbuf() = std::move(*fout.rdbuf());

    getline(fin, s);
    std::cout << s << '\n'; // empty line

    std::cout << std::boolalpha << fout.is_open() << '\n'; // prints "false"

}


Ver también

construye un objeto basic_filebuf
Original:
constructs a basic_filebuf object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función miembro pública) [editar]
(C++11)
swaps dos objetos basic_filebuf
Original:
swaps two basic_filebuf objects
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función miembro pública) [editar]