1
vote
Vote UpVote

Spring4D How to correctly assign NULL to a Nullable type?

The Wiert Corner – Since I tend to forget this: [WayBack] Spring4D How to correctly assign NULL to a Nullable type? this is correct? fDateTime = Null; or this? fDateTime := nil; – Jacek Laskowski – Google+ The preferred way is fDateTime := nil. This is possible because of [WayBack] Delphi sorcery: How to create an operator overload that only accepts nil using a reference type (in this case interface) so no non-nil pointers can be passed: type Nullable<T> = record strict private type Null = interface end; public class operator Implicit(const value: Null): Nullable<T>; end; ...
Favorite? Off-Topic? jpluimers @ 2018-12-19 18:04

Statistics

Visits: 160
Votes: 1
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Alister Christie
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)