3 votes by cmhobbs 4 months ago — 3 votes, 1 comments

Note: The following is all standard-conforming C++, this is not a hypothetical language extension

This confused me, because I thought this code was valid (default) C++

assert( I-I == 0 );

assert( I---I == 1 );

assert( I-----I == 2 );

assert( I-------I == 3 );

but this doesn't work "out of the box", you have to define a class and override some operators...