isNarrowString to be converted to an array of dchar
a dchar[], const(dchar)[], or immutable(dchar)[] depending on the constness of the input.
import std.range.primitives : isRandomAccessRange; import std.traits : isAutodecodableString; // note that if autodecoding is turned off, `array` will not transcode these. static if (isAutodecodableString!string) assert("Hello D".array == "Hello D"d); else assert("Hello D".array == "Hello D"); static if (isAutodecodableString!wstring) assert("Hello D"w.array == "Hello D"d); else assert("Hello D"w.array == "Hello D"w); static assert(isRandomAccessRange!dstring == true);
Convert a narrow autodecoding string to an array type that fully supports random access. This is handled as a special case and always returns an array of dchar
NOTE: This function is never used when autodecoding is turned off.