[TIMOB-18860] Windows: Introduce Nullable templated type in TitaniumKit APIs
GitHub Issue | n/a |
---|---|
Type | Story |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-05-21T12:18:56.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Windows |
Labels | n/a |
Reporter | Christopher Williams |
Assignee | Christopher Williams |
Created | 2015-04-29T18:45:05.000+0000 |
Updated | 2017-03-16T21:50:27.000+0000 |
Description
We have no notion of "null" primitive values. This is problematic when we have special arguments/parameter structs like MatrixCreationDict. It's also problematic if we want to check if a property has never been assigned a value (say color, on an animation).
We can use "default" values and check for those (such as empty string), but for double/int32_t, uint32_t that's often more problematic. We want to explicitly know if the user gave a 0/-1/whatever versus never having set a value.
There's the boost:optional type we could use, or we could simply make our own type.
Sounds like that's a right place for
boost::optinal
. Is there any possible issues/concerns for it?[~kota] I think boost::optional looks good enough to use. No reason to re-invent the wheel if they already have it and we already have a dependency on boost.
https://github.com/appcelerator/titanium_mobile_windows/pull/245
Closing ticket as the issue has been fixed.