this is null

ANtlord antlord92 at gmail.com
Sat Mar 9 20:11:14 UTC 2019


On Saturday, 9 March 2019 at 20:04:53 UTC, Paul Backus wrote:
>
> struct S
> {
>     bool isThisNull() { return &this is null; }
> }
>
> void main()
> {
>     import.std.stdio;
>     S* p = null;
>     writeln((*p).isThisNull); // true
> }
>
> Interactive version: https://run.dlang.io/is/fgT2rS

Anyway, thank you! I didn't know about the feature.


More information about the Digitalmars-d-learn mailing list