27 lines
723 B
C
27 lines
723 B
C
![]() |
/**
|
||
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||
|
*
|
||
|
* This source code is licensed under the MIT license found in the
|
||
|
* LICENSE file in the root directory of this source tree.
|
||
|
*/
|
||
|
|
||
|
struct YGFloatOptional {
|
||
|
private:
|
||
|
float value_;
|
||
|
bool isUndefined_;
|
||
|
|
||
|
public:
|
||
|
YGFloatOptional(const float& value);
|
||
|
YGFloatOptional();
|
||
|
|
||
|
// 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.
|
||
|
// To check if float optional is defined, use `isUndefined()`.
|
||
|
float getValue() const;
|
||
|
|
||
|
// Sets the value of float optional, and thus isUndefined is assigned false.
|
||
|
void setValue(const float& val);
|
||
|
|
||
|
bool isUndefined() const;
|
||
|
};
|