built-in that returns the parent of a struct member. It can be statically
checked and thus always work as long as the fallowing constraints are
parent() on the same type in the same function return the type (and
corresponding pointer offset) corresponding to the first call of parent()
on that type in the function
parent() on the same struct member (this always has the same address)
return the same result as the first call of parent() on this struct member.
-- this is only useful when the result of parent() isn't acutally the
parent, and thus is kinda gross, but allows Tree Root node accessors.
It would be expected that the compiler would optimize these calls into a
simple subtraction from a value that would be passed on the stack. Fuctions
would be tagged by the compiler as to what offsetof() result to give them.
I've written a redblack tree implementation that uses this
I could write a linked-list that would use this and be simpler for a first
compiler target, based on this attempt to hack it in without compiler
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
For more options, visit https://groups.google.com/d/optout.