A
Atlas
I tried the following in MSVC7.1 but was told "unable to deduce
template parameter".
template <int L, int M, int T> class Quantity;
template <int L, int M, int T> Quantity<L/2,M/2,T/2> sqrt(const
Quantity<L,M,T>& q);
template <int L, int M, int T>
class Quantity
{public:...
friend Quantity<L/2,M/2,T/2> sqrt<L,M,T>(const Quantity<L,M,T>& q);
};
template <int L,int M, int T>
Quantity<L/2,M/2,T/2> sqrt(const Quantity<L,M,T>& q)
{
Quantity<L/2,M/2,T/2> q1;
return q1;
};
That's for a unit system operation.
I succeed with return type like <L1+L2,M1+M2,T1+T2> (For multiply).
Also for pow, I failed.
template parameter".
template <int L, int M, int T> class Quantity;
template <int L, int M, int T> Quantity<L/2,M/2,T/2> sqrt(const
Quantity<L,M,T>& q);
template <int L, int M, int T>
class Quantity
{public:...
friend Quantity<L/2,M/2,T/2> sqrt<L,M,T>(const Quantity<L,M,T>& q);
};
template <int L,int M, int T>
Quantity<L/2,M/2,T/2> sqrt(const Quantity<L,M,T>& q)
{
Quantity<L/2,M/2,T/2> q1;
return q1;
};
That's for a unit system operation.
I succeed with return type like <L1+L2,M1+M2,T1+T2> (For multiply).
Also for pow, I failed.