Running this program will cause it to fail an assertion, print an error message and stack trace, and exit with a non-zero status.
When the first assert in main fires, the program exits without reaching the rest of the code. If you’d like to see the program try to create a temp file, comment the first assert out.
Note that unlike some languages which use exceptions for handling of many errors, in D it is idiomatic to use error-indicating return values wherever possible. However, for unexpected errors or programming mistakes, assertions are commonly used.
In D, assert is used for debugging and can be disabled in release builds, while enforce (from std.exception) is used for runtime checks that should always be active.