Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
'operator operator' cannot have default parameters
Only three operators can have default parameters:
Assignment =
Left parenthesis (
The following sample generates C2831:
// C2831.cpp
// compile with: /c
#define BINOP <=
class A {
public:
int i;
int operator BINOP(int x = 1) { // C2831
// try the following line instead
// int operator BINOP(int x) {
return i+x;
}
};