[phobos] array() function

Andrei Alexandrescu andrei at erdani.com
Thu Jan 20 19:59:42 PST 2011


I'm seeing a recently-added overload of array() that spells:

==========
ElementType!(String)[] array(String)(String str);

     Convert a narrow string to an array type that fully supports random 
access. This is handled as a special case and always returns a dchar[], 
const(dchar)[], or immutable(dchar)[] depending on the constness of the 
input.
==========

What are some good use cases for it?


Andrei


More information about the phobos mailing list