Compiler Error C2549

user-defined conversion cannot specify a return type

A user-defined conversion cannot specify a return type.

The following is an example of this error:

class X
{
public:
   int operator int() { return value; }   // error
   operator int() { return value; }       // OK
private:
   int value;
};