#ifndef __FOO_H__
#define __FOO_H__

#include <iostream>

class Foo {
  int N;
public:
#ifdef PRINT_CTOR_DTOR
  Foo(int n=0) : N(n) 
    { std::cout << "Foo::Foo(" << N << ')' << std::endl; };
  ~Foo() 
    { std::cout << "Foo::~Foo()" << std::endl; }
#else
  Foo(int n=0) : N(n) {};
  ~Foo() {}
#endif
  void printOn(std::ostream& os) const
    { os << "Foo(" << N << ")"; }
  friend std::ostream& operator<<(std::ostream& os,const Foo& f)
    { f.printOn(os); return os; }
  friend bool operator==(const Foo& x, const Foo& y)
    { return x.N == y.N; }
  friend bool operator<(const Foo& x, const Foo& y)
    { return x.N < y.N; }
};

#endif
