Skip to content

Latest commit

 

History

History
61 lines (56 loc) · 1.1 KB

compiler-error-c2582.md

File metadata and controls

61 lines (56 loc) · 1.1 KB
title Compiler Error C2582 | Microsoft Docs
ms.custom
ms.date 11/04/2016
ms.reviewer
ms.suite
ms.technology
cpp-tools
ms.tgt_pltfrm
ms.topic error-reference
f1_keywords
C2582
dev_langs
C++
helpviewer_keywords
C2582
ms.assetid ee1b9378-8bcd-4792-b87e-6d7a466d29ed
caps.latest.revision 13
author corob-msft
ms.author corob
manager ghogen
translation.priority.ht
cs-cz
de-de
es-es
fr-fr
it-it
ja-jp
ko-kr
pl-pl
pt-br
ru-ru
tr-tr
zh-cn
zh-tw

Compiler Error C2582

'function' function is unavailable in 'type'

An attempt was made to assign to an object that does not have an assignment operator.

The following sample generates 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  
}