As you can see in the following code, I attempt to have some default arguments of the function "initialize" that are union. How to change the definition of the function "initialize" to make it compatible with C++ before C++ 11? Do I need to add some constructors to RedBlackPointer? If so, how?
template <typename T> class RedBlackNode{
protected:
union RedBlackPointer{
RedBlackNode *node;
struct{
unsigned value:1; // for color / other info
}flag;
}left, right, parent;
T key;
public:
void initialize(T key, RedBlackPointer left = {(RedBlackNode*)0},
RedBlackPointer right = {(RedBlackNode*)0},
RedBlackPointer parent = {(RedBlackNode*)0}){
this->key = key;
this->left = left; this->right = right;
this->parent = parent;
}
}