#include <iostream>
template<typename T>
class Point {
private:
T px, py;
public:
Point(T x, T y): px(x), py(y) {
std::cout << "created " << x << ":" << y <<std::endl;
};
T x() const { return px; };
T y() const { return py; };
};
class PointWorld : public Point<double> {
using Point::Point;
};
class PointScreen: public Point<int> {
using Point::Point;
};
int main() {
std::cout << PointScreen(100, 100).x() << std::endl;
return 0;
}
ICAgICNpbmNsdWRlIDxpb3N0cmVhbT4KCiAgICB0ZW1wbGF0ZTx0eXBlbmFtZSBUPgogICAgY2xhc3MgUG9pbnQgewogICAgICAKICAgICAgcHJpdmF0ZToKICAgICAgICBUIHB4LCBweTsKICAgICAgICAKICAgICAgcHVibGljOgogICAgICAgIFBvaW50KFQgeCwgVCB5KTogcHgoeCksIHB5KHkpIHsKICAgICAgICAgIHN0ZDo6Y291dCA8PCAiY3JlYXRlZCAiIDw8IHggPDwgIjoiIDw8IHkgPDxzdGQ6OmVuZGw7CiAgICAgICAgfTsKICAgICAgICBUIHgoKSBjb25zdCB7IHJldHVybiBweDsgfTsKICAgICAgICBUIHkoKSBjb25zdCB7IHJldHVybiBweTsgfTsKICAgICAgCiAgICB9OwoKICAgIGNsYXNzIFBvaW50V29ybGQgOiBwdWJsaWMgUG9pbnQ8ZG91YmxlPiB7CiAgICAgIHVzaW5nIFBvaW50OjpQb2ludDsKICAgIH07CgogICAgY2xhc3MgUG9pbnRTY3JlZW46IHB1YmxpYyBQb2ludDxpbnQ+IHsKICAgICAgdXNpbmcgUG9pbnQ6OlBvaW50OwogICAgfTsKCgogICAgaW50IG1haW4oKSB7CiAgICAKICAgICAgc3RkOjpjb3V0IDw8IFBvaW50U2NyZWVuKDEwMCwgMTAwKS54KCkgPDwgc3RkOjplbmRsOwogICAgICAKICAgICAgcmV0dXJuIDA7CiAgICAgIAogICAgfQo=