isNarrowString to be converted to an array of dchar
a dchar[], const(dchar)[], or immutable(dchar)[] depending on the constness of the input.
1 import std.range.primitives : isRandomAccessRange; 2 import std.traits : isAutodecodableString; 3 4 // note that if autodecoding is turned off, `array` will not transcode these. 5 static if (isAutodecodableString!string) 6 assert("Hello D".array == "Hello D"d); 7 else 8 assert("Hello D".array == "Hello D"); 9 10 static if (isAutodecodableString!wstring) 11 assert("Hello D"w.array == "Hello D"d); 12 else 13 assert("Hello D"w.array == "Hello D"w); 14 15 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.