Compiler Error C2808

 

For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.

For the latest documentation on Visual Studio 2017, see Compiler Error C2808 on docs.microsoft.com. unary 'operator operator' has too many formal parameters

The unary operator has a nonvoid parameter list.

The following sample generates C2808:

// C2808.cpp  
// compile with: /c  
class X {  
public:  
   X operator! ( X );   // C2808 nonvoid parameter list  
   X operator! ( void );   // OK  
};  
  

Show: