#pragma once template class TPoint : private std::pair { public: Type x = &first; Type y = &second; TPoint(Type x, Type y) : first(x), second(y) { }; Type& x() { return first; }; Type& y() { return second; }; }; typedef TPoint<> Point;