t { void test(S)(S s) { import std.utf : byCodeUnit; import std.algorithm.comparison : equal; assert(equal(s.byCodeUnit, s.ptr.nullTerminatedPtrRange)); } // String literals are null-terminated test("foo"); test("foo"w); test("foo"d
See Implementation