#include <iostream>
using namespace std;
class base
{
friend class derived; //<======= note this line
private:
base()
{
cout << "base: ctor()\n";
}
};
class derived: public base
{
public:
derived()
{
cout << "derived: ctor()\n";
}
};
int main()
{
derived d;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmNsYXNzIGJhc2UKewogICBmcmllbmQgY2xhc3MgZGVyaXZlZDsgLy88PT09PT09PSBub3RlIHRoaXMgbGluZQogICBwcml2YXRlOgogICAgICBiYXNlKCkKICAgICAgewogICAgICAgICBjb3V0IDw8ICJiYXNlOiBjdG9yKClcbiI7CiAgICAgIH0KfTsKCmNsYXNzIGRlcml2ZWQ6IHB1YmxpYyBiYXNlCnsKICAgcHVibGljOgogICAgICBkZXJpdmVkKCkKICAgICAgewogICAgICAgICBjb3V0IDw8ICJkZXJpdmVkOiBjdG9yKClcbiI7CiAgICAgIH0KfTsKCmludCBtYWluKCkKewogICBkZXJpdmVkIGQ7Cn0=