Closed mwielbut closed 1 year ago
Lgtm! Thank you. Will create a new release in the morning
@markphelps any chance we could deploy today? I'd love to update our code to use this :)
@mwielbut thanks again for the contribution!!
I just created https://github.com/markphelps/optional/releases/tag/v0.11.0 with the change
I'm going to be paying more attention to this library going forward and hope to do more regular releases. Thanks again!
This PR adds some convenience methods to make it easier to convert between pointer and Optional representation of values.
Using the Optional package inevitably leads to lots of code like this when we need to convert back to pointers:
or the other way:
Two new functions are introduced, one to create an Optional given a pointer, and the other to return the embedded value as a pointer. Note, in both cases the value is copied over, the pointer is never passed directly as that would break the encapsulation.
With the two methods, the above examples become simple one-line statements: