#include <iostream>

class foo {
public:
   foo() : i(1), j(2) {}

   int i; 
   int j; 
   bool operator<(const foo& val) {
     std::cout << "memba\n";
     return i<val.i;
   }
};

bool operator<(const foo& lhs, const foo& rhs) {
   std::cout << "free\n";
   return lhs.j < rhs.j;
}

int main()
{
    foo f1, f2;
    bool b1 = f1 < f2;

    foo const f3;
    bool b2 = f3 < f2;

    return b1 + b2;
}
