// Example 2-3: Name lookup trumps overload resolution.
#include <ios>
#include <iostream>
#include <ostream>

void func(int i)
{
  std::cout << "int: " << i << '\n';
}

namespace N {
  void func(double d)
  {
    std::cout << "double: " << std::showpoint << d << '\n';
  }

  void call_func()
  {
    // Even though func(int) is a better match, the compiler
    // finds N::func(double) first.
    func(3);
  }
}

int main()
{
  N::call_func();       // prints "double: 3.000000"
  using N::func;
  using ::func;
  // Now all overloaded func()s are at the same scope level
  func(4);              // prints "int: 4"
}
