I have two almost identical classes, in fact, each member function is identical, each member is identical, each member function does the same. The only difference between these classes is how I can define a variable of their type:
AllocFactorScientific<102,-2> scientific;
AllocFactorLinear<1.2> linear;
Here are the headings for them:
template<double&& Factor>
struct AllocFactorLinear;
template<short Mantissa, short Exponent, short Base = 10>
struct AllocFactorScientific
My question is how can I reorganize these functions from those classes that would allow me to have only one set of functions, and not two sets of identical functions.
source
share