Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That will never happen on current or future platforms, and is not a big concern. Or perhaps it'd be better to say that if it ever does happen on a future platform, then a few memset calls are going to be the least of your problems when porting legacy C code to that platform.

However, what has bitten me is memsetting structures that I later turn into full-fledged classes in C++. Oops, there went the VMT.

Designated initializers are very nice, as is the ability (in C++) to provide initial-value assignments that run before the constructor.



I do wish there was a compact way to tell a C++ class to zero init all pointer/numeric members to zero.


What's wrong with:

  T foo = {}


I mean in the constructor... Can one do *this ={}?




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

Search: