Using enum constant from different modules
via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu Jul 10 14:48:10 PDT 2014
On Thursday, 10 July 2014 at 20:59:17 UTC, simendsjo wrote:
> Strings behaves a bit odd with is(). The following passes:
>
> import std.stdio;
> void f(string a, string b) {
> assert(a is b); // also true
> }
> void main() {
> string a = "aoeu";
> string b = "aoeu";
> assert(a is b); // true
> f(a, b);
> writeln("passed");
> }
>
> changing a and b to enum gives the same results.
Try other immutable variables (int arrays, structs), and
non-immutable ones. They will probably behave differently.
More information about the Digitalmars-d-learn
mailing list