Skip to content

Instantly share code, notes, and snippets.

@run-dlang
Created April 3, 2018 14:50
Show Gist options
  • Select an option

  • Save run-dlang/390128568448567156b5c85f51fe9ed5 to your computer and use it in GitHub Desktop.

Select an option

Save run-dlang/390128568448567156b5c85f51fe9ed5 to your computer and use it in GitHub Desktop.
Code shared from run.dlang.io.
void main()
{
import std.stdio: write, writeln, writef, writefln;
int i;
enum Foo { E }
Foo f;
i = f; // OK
f = i; // error
f = cast(Foo)i; // OK
f = 0; // error
f = Foo.E; // OK
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment