Distinguish between a null array and an empty array

ag0aep6g anonymous at example.com
Sun May 24 12:37:20 UTC 2020


On 24.05.20 14:29, bauss wrote:
> Dang, that sucks there is no proper way and I would say that's a big 
> flaw of D.
> 
> Because what I need it for is for some data serialization but if the 
> value is an empty array then it should be present and if it's null then 
> it should not be present.
> 
> Since null is used to say "ignore this" in the data serialization.

You can use std.typecons.Nullable (or a similar wrapper) to add an extra 
"ignore this" value to a type.


More information about the Digitalmars-d-learn mailing list