On 2009-04-16 18:19:36 +0200, bearophile <[email protected]> said:

[...]
struct TST(T) {
    TST* left, right;
    union {
      TST* mid;
      int index;
    }
    T item;

    // methods here
}

Note that inside there you don't need TST!(T)*, TST* is probably enough, but I don't know why yet.

struct TST(T){ ... }

is syntactic sugar for

template TST(T){
 struct TST{ ...}
}

so TST in the structure refers by default to the struct itself.

Fawzi

Reply via email to