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;
};
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for