Replaced default constructors with member assignments

Reviewed By: davidaurelio

Differential Revision: D10466125

fbshipit-source-id: ed92d1e054a8b5b9a6c8c09035173b11da45c368
This commit is contained in:
Sidharth Guglani
2018-10-25 08:02:04 -07:00
committed by Facebook Github Bot
parent ba9bd4eae3
commit fad2ee1a64
7 changed files with 75 additions and 133 deletions

View File

@@ -9,12 +9,12 @@
struct YGFloatOptional {
private:
float value_;
bool isUndefined_;
float value_ = 0;
bool isUndefined_ = true;
public:
explicit YGFloatOptional(float value);
explicit YGFloatOptional() : value_(0), isUndefined_(true) {}
YGFloatOptional() = default;
// Program will terminate if the value of an undefined is accessed. Please
// make sure to check if the optional is defined before calling this function.