#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();
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKbmFtZXNwYWNlIGxpYnJhcnkgewoKLy8gbGlicmFyeS5oCi8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCmNsYXNzIEludGVyZmFjZSB7CiAgcHVibGljOgogICAgSW50ZXJmYWNlKCk7CgogICAgfkludGVyZmFjZSgpOwoKICAgIHZvaWQgZigpOwoKICBwcml2YXRlOgogICAgY2xhc3MgSW1wbDsKICAgIEltcGwqIG1faW1wbDsKfTsKLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KCi8vIGxpYnJhcnkuY3BwCi8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCmNsYXNzIEludGVyZmFjZTo6SW1wbCB7CiAgcHVibGljOgogICAgdm9pZCBmKCkgewogICAgICBzdGQ6OmNvdXQgPDwgImYiIDw8IHN0ZDo6ZW5kbDsKICAgIH0KfTsgIAoKSW50ZXJmYWNlOjpJbnRlcmZhY2UoKSB7CiAgbV9pbXBsID0gbmV3IEludGVyZmFjZTo6SW1wbCgpOwp9ICAgCgpJbnRlcmZhY2U6On5JbnRlcmZhY2UoKSB7CiAgZGVsZXRlIG1faW1wbDsKfQoKdm9pZCBJbnRlcmZhY2U6OmYoKSB7CiAgbV9pbXBsLT5mKCk7Cn0KLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KCn0KCmludCBtYWluKCkKewogIGF1dG8gbyA9IGxpYnJhcnk6OkludGVyZmFjZSgpOwogIG8uZigpOwp9