Skip to content

Latest commit

 

History

History
36 lines (33 loc) · 760 Bytes

compiler-error-c2549.md

File metadata and controls

36 lines (33 loc) · 760 Bytes
title ms.custom ms.date ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic f1_keywords dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
Compiler Error C2549 | Microsoft Docs
11/04/2016
cpp-tools
error-reference
C2549
C++
C2549
29310094-54a3-4605-bc6d-a312a68daf5d
8
corob-msft
corob
ghogen

Compiler Error C2549

user-defined conversion cannot specify a return type

The following sample generates C2549:

// C2549.cpp  
// compile with: /c  
class X {  
public:  
   int operator int() { return value; }   // C2549  
  
   // try the following line instead  
   // operator int() { return value; }  
private:  
   int value;  
};