News for hackers. Stuff that matters.

typelist

Re:Zeroing Memory is Hard: VC++ 2015 arrays on Monday July 18, 2016 @12:01PM (#12115864)
Ah, interesting. Apparently this is true even if some constructors are explicitly '= default' (for the T x{} and T x={} list/aggregate initialization cases only).

But I believe that rule doesn't apply for any objects where adding an '= default' constructor would be useful, because it requires that there be no user-defined constructors or private/protected members. Otherwise that syntax ultimately calls the default constructor, which won't do any zeroing.

See http://en.cppreference.com/w/cpp/language/aggregate_initiali...

Re:Zeroing Memory is Hard: VC++ 2015 arrays on Monday July 18, 2016 @02:18AM (#12113482)
Explicitly defaulting the constructor behaves the same as an empty constructor: all members are default-initialized. The problem is usually that 'default-initializing' doesn't zero out primitive (POD) types, but leaves them uninitialized.
Re:The Periodic Table of Rust Types on Wednesday January 15, 2014 @09:55AM (#7063625)
"When you enter SafeD, you leave your pointers, unchecked casts and unions at the door. Memory management is provided to you courtesy of Garbage Collection."