WTF needs a smart pointer to handled foo->ref(this) style reference counting I would hope something like that should be possible. I'm not sure if it's possible to reference "this" from a variable declaration however.