Compartir a través de


Error del compilador C2582

La función 'función' no está disponible en 'tipo'

Se ha intentado una asignación a un objeto que no tiene un operador de asignación.

El ejemplo siguiente genera el error C2582:

// C2582.cpp
// compile with: /clr
using namespace System;

struct N {};
ref struct O {};
ref struct R {
   property O prop;   // C2582
   property O ^ prop2;   // OK
};

int main() {
   String ^ st1 = gcnew String("");
   ^st1 = gcnew String("");   // C2582
   st1 = "xxx";   // OK
}