私たちのプロジェクトでは、次のようなものがあります。
struct PointI
{
// methods for getting, setting and calculating some point stuff
private:
int x;
int y;
};
struct PointD
{
// methods for getting, setting and calculating some point stuff
private:
double x;
double y;
};
私はそれをそのようなものに変更することを提案しました:
template<typename T>
struct Point
{
// methods for gettig, setting and calculating some point stuff
private:
T x;
T y;
};
typedef Point<int> PointI;
typedef Point<double> PointD;
typedef Point<float> PointF;
しかし、それは拒否され、私は次のように言われました。
その議論は、多くのコードの重複を許すほど強力ですか?