Hacker News new | past | comments | ask | show | jobs | submit login

I'm a big fan of:

    this->~MyClass();
    new (this) MyClass();
I have unironically used this



I hope you are confident that this doesn’t point to an instance of a derived class.


Of course :p


Yeah, I too have used this to wrap message buffers passed to and from kernel and user space; quite handy if you design and use the class with discipline.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: