There is something like this in our project:
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; };
I suggested changing this to something like this:
template<typename T> struct Point {
But it was refused, and they told me: "There is one problem with this approach - changing and exporting characters in C ++. Templates are so long when used in exported characters (APIs that use them), and there is no way to export templates."
Is this argument so strong as to allow a lot of code duplication?
source share