#include <iostream>
using namespace std;

namespace library {

// library.h
//---------------------------
class Interface {
  public:
    Interface();

    ~Interface();

    void f();

  private:
    class Impl;
    Impl* m_impl;
};
//---------------------------

// library.cpp
//---------------------------
class Interface::Impl {
  public:
    void f() {
      std::cout << "f" << std::endl;
    }
};  

Interface::Interface() {
  m_impl = new Interface::Impl();
}   

Interface::~Interface() {
  delete m_impl;
}

void Interface::f() {
  m_impl->f();
}
//---------------------------

}

int main()
{
  auto o = library::Interface();
  o.f();
}