Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Compiler Error C2549
Collapse the table of content
Expand the table of content

Compiler Error C2549

user-defined conversion cannot specify a return type

The following sample generates C2549:

// C2549.cpp
// compile with: /c
class X {
   int operator int() { return value; }   // C2549

   // try the following line instead
   // operator int() { return value; }
   int value;

Community Additions

© 2015 Microsoft