Better HN
topnewbestaskshowjobs
Log inSign up

typelist

9 karma · joined Jan 15, 2014 (12y ago) · 3 submissions

Submissions

comment 10y ago · link · parent

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...

comment 10y ago · link · parent

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.

comment 12y ago · link · parent

"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."