Work around an MSVC2013 value-initialization bug.

See https://connect.microsoft.com/VisualStudio/feedback/details/793506.
pull/4/head
whitequark 2015-12-28 23:46:08 +08:00
parent 9d2a035a71
commit 86f0439521
1 changed files with 6 additions and 2 deletions

View File

@ -441,7 +441,11 @@ public:
// Necessary for Entity e = {} to zero-initialize, since
// classes with base classes are not aggregates and
// the default constructor does not initialize members.
Entity() : EntityBase(), forceHidden(), actPoint(), actNormal(),
//
// Note EntityBase({}); without explicitly value-initializing
// the base class, MSVC2013 will default-initialize it, leaving
// POD members with indeterminate value.
Entity() : EntityBase({}), forceHidden(), actPoint(), actNormal(),
actDistance(), actVisible(), style(), construction(),
dogd() {};
@ -624,7 +628,7 @@ public:
class Constraint : public ConstraintBase {
public:
// See Entity::Entity().
Constraint() : ConstraintBase(), disp(), dogd() {}
Constraint() : ConstraintBase({}), disp(), dogd() {}
// These define how the constraint is drawn on-screen.
struct {