On Wednesday, 27 June 2018 at 12:02:10 UTC, aliak wrote:
===
The use case is for a non-nullable type, where I want to
guarantee that the value inside will never be null. I can't do
it for inner classes though. And I can't allow the user to do
something like:
void main() {
class C {}
auto s = construct(new C);
}
Because I can't guarantee that's not null.
Cheers,
- Ali
Is there any reason, why you don't want to use a struct? An
instance of such is never null, still having access to its
context, if it is a function.