Open adam-wyluda opened 8 years ago
Also the benefit of having an Option as a return type for methods, is that it can dereference primitive type values to memory instead of returning them directly, which effectively allows us to have null references of the primitives.
Sounds good to me.
It would work like one-element off-heap array. Option.empty would be just a null reference, otherwise it will point to address containing value of this Option.
The use case for this class is return value of some off-heap collection methods, such as find or get in Map.