import std.range : iota; auto obs = from(iota(10)); auto res = new int[10]; auto d = obs.subscribe(res[]); scope (exit) d.dispose(); assert(res.length == 10); assert(res[0] == 0); assert(res[9] == 9);
import std.range : iota; auto obs = iota(10).asObservable(); auto res = new int[10]; auto d = obs.subscribe(res[]); scope (exit) d.dispose(); assert(res.length == 10); assert(res[0] == 0); assert(res[9] == 9);