[fpc-devel] "Default" discussion for SmartPointers etc
hnb.code at gmail.com
Thu Jul 28 18:09:14 CEST 2016
2016-07-28 17:58 GMT+02:00 Michael Van Canneyt <michael at freepascal.org>:
> Then you will not have this problem; GetValue will always return a
> 'Default' value.
IMO bad design. You can't use value of not assigned nilable types as same
as you can't use not assigned pointers >.<.
There is no magic in ^ . Just look at declaration:
Instance: ^T default;
you can create alternative nilable struct with:
FInstance: T default;
with that you don't need any ^ operator
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-devel