Created
January 24, 2019 04:09
-
-
Save run-dlang/809bd9a1555a66a3ad69d32c12b9a191 to your computer and use it in GitHub Desktop.
Code shared from run.dlang.io. Run with '-unittest'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() | |
{ | |
import std.algorithm, std.conv, std.stdio; | |
"Starting program".writeln; | |
// Sort a constant declaration at Compile-Time | |
enum a = [ 3, 1, 2, 4, 0 ]; | |
static immutable b = sort(a); | |
// Print the result _during_ compilation | |
pragma(msg, text("Finished compilation: ", b)); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment