Gistrec icon

Template point

Gistrec | PRO | 06/04/19 10:54:05 AM UTC | 0 ⭐ | 717 👁️ | Never ⏰ | []
C++ |

280 B

|

None

|

0 👍

/

0 👎

#pragma once
 
template <class Type = double>
class TPoint : private std::pair<Type, Type> {
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;

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎