value to wrap into Optional
wrapped value
Optional!(int) foo ( bool x ) { if (x) return optional(42); else return Optional!(int).undefined; } foo(true).visit( () { test(false); }, (ref int value) { test(value == 42); } ); foo(false).visit( () { }, (ref int value) { test(false); } );
Shortcut on top of Optional to created defined value, uses IFTI to reduce the noise