Point* move(Point* p, int d);require int Point::x
Point* move(Point* p, int d) { p.x += d; return p; }
template< class T >requires T::value()
class P { public: P(T& r) : t(r) {} int operator==( P<T>& p) { return t.value() == p.t.value(); } private: T& t; };
template< class T > class A {public: virtual T value() = 0; }; class Int : public A<int> {
A<T> public: Int(int n = 0) : _n(n) {} int value() { return _n; } private: int _n; };
Int A<int>
Int i1, i2; P<Int> p1(i1), p2(i2); if ( p1 == p2 ) cout << "OK" << endl;OK