Operators and Expressions

+ - * / % ^^ (^^ = power) is, !is (reference/bitwise identity: obj is null)

& | ^ ~ << >> >>> (>>> = unsigned shift) ~, ~= (arrays/strings) ++ -- (prefix/postfix) cond ? a: b

in (associative arrays: returns a pointer or null), !in [a.. b], $ (length inside an index/slice)

typeof(expr), typeid(T), is(T == U)

writeln(2 ^^ 10);             // 1024
writeln(7 / 2, " ", 7 % 2);   // 3 1
writeln(7.0 / 2);             // 3.5
string s = "Hello" ~ ", " ~ "D";
int[] arr = [1, 2] ~ [3];
Object o = null;
if (o is null) writeln("null");

5.1 UFCS (Uniform Function Call Syntax)

import std.algorithm, std.range, std.stdio;
int square(int x) { return x * x; }
writeln(5.square);                                // square(5)
[3, 1, 2].sort.map!(x => x * 10).writeln;         // pipeline style
iota(1, 11).filter!(x => x % 2 == 0).map!square.sum.writeln;