1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#include <iostream> using namespace std; class A { public: A() { } void operator+(int) { cout << "+" << endl; } }; void operator-(A &&, int) { cout << "-" << endl; } int main() { A() + 1; A() - 1; return 0; }
1 2
Line 15: error: expected ',' or '...' before '&&' token compilation terminated due to -Wfatal-errors.