assertTrue(isSame!(int, int)); assertFalse(isSame!(int, short)); enum a = 1, b = 1, c = 2, s = "a", t = "a"; assertTrue(isSame!(1, 1)); assertTrue(isSame!(a, 1)); assertTrue(isSame!(a, b)); assertFalse(isSame!(b, c)); assertTrue(isSame!("a", "a")); assertTrue(isSame!(s, "a")); assertTrue(isSame!(s, t)); assertFalse(isSame!(s, "g")); assertFalse(isSame!(1, "1")); assertFalse(isSame!(a, "a")); assertTrue(isSame!(isSame, isSame)); assertFalse(isSame!(isSame, a)); assertFalse(isSame!(byte, a)); assertFalse(isSame!(short, isSame)); assertFalse(isSame!(a, int)); assertFalse(isSame!(long, isSame)); static immutable X = 1, Y = 1, Z = 2; assertTrue(isSame!(X, X)); assertFalse(isSame!(X, Y)); assertFalse(isSame!(Y, Z)); int foo(); int bar(); real baz(int); assertTrue(isSame!(foo, foo)); assertFalse(isSame!(foo, bar)); assertFalse(isSame!(bar, baz)); assertTrue(isSame!(baz, baz)); assertFalse(isSame!(foo, 0)); int x, y; real z; assertTrue(isSame!(x, x)); assertFalse(isSame!(x, y)); assertFalse(isSame!(y, z)); assertTrue(isSame!(z, z)); assertFalse(isSame!(x, 0));
Checks if two symbols are the same in compile-time