[ create a new paste ] login | about

Link: http://codepad.org/sS6hAwjc    [ raw code | output | fork ]

C++, pasted on Apr 4:
#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;
}


Output:
1
2
Line 15: error: expected ',' or '...' before '&&' token
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: