2 * Copyright (c) 2014-present, Facebook, Inc.
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
10 struct YGFloatOptional {
16 explicit YGFloatOptional(const float& value);
17 explicit YGFloatOptional();
19 // Program will terminate if the value of an undefined is accessed. Please
20 // make sure to check if the optional is defined before calling this function.
21 // To check if float optional is defined, use `isUndefined()`.
22 const float& getValue() const;
24 // Sets the value of float optional, and thus isUndefined is assigned false.
25 void setValue(const float& val);
27 const bool& isUndefined() const;
29 YGFloatOptional operator+(const YGFloatOptional& op);
30 bool operator>(const YGFloatOptional& op) const;
31 bool operator<(const YGFloatOptional& op) const;
32 bool operator>=(const YGFloatOptional& op) const;
33 bool operator<=(const YGFloatOptional& op) const;
34 bool operator==(const YGFloatOptional& op) const;
35 bool operator!=(const YGFloatOptional& op) const;
37 bool operator==(const float& val) const;
38 bool operator!=(const float& val) const;