previous | start | next

Problem

For numbers, of course

a + 1 is the same as 1 + a
   

So we might want to write

  Pair p1(2,3);
  Pair p2(5,5);

  Pair p;

  p = 1 + p1; // PROBLEM

The expression

      1 + p1      
   

cannot mean

      1.operator+(p1)      
   

since 1 is not a Pair.



previous | start | next