I am trying to create a template that behaves differently
if it is give a primative type vs a class. I should be easy
enough but my brain seems to be stuck in neutral.
Here is the general problem
template< class T, class S>
struct Node
{
Node* MyNode;
T Value;
}
template< class T, class S>
class Myclass
{
T GetValue();
operator== (T rhs);
Node node;
}
In the case that T is a class, T will look somethink like this.
template< class T, class S>
class MyVector
{
int size;
float length;
S value;
}
Here are the requirements.
If T is a a primative (int, long, float, double, char...), S will be a primative of the same type
GetValue will return the value of classInst1.node.value
The operator== will compare classInst1.node.value == classInst2.node.value
If T is a class, S will be a primative.
GetValue will return the value of classInst1.node.value
The operator== will compare classInst1.node.<T>value.value == classInst2.node.<T>value.value