Examples
Read JSON file with coordinates.
struct Point3D { double x, y, z; }
void main()
{
import fast.json;
auto points = json.coordinates.read!(Point3D[]);
}
SSE3 accelerated splitting around ‘/’ and ‘\’
string rest = pathname
string element;
import fast.string;
while (rest.split!`or(=\,=/)`(element, rest))
{
// `element' is now the next directory.
// `rest' is what remains after the \ or /.
}
// `element` is now the file name part of the path.
Calling Windows API functions.
void createHardlink(string from, string to)
{
import fast.cstring : wcharPtr;
CreateHardLinkW(wcharPtr!to, wcharPtr!from, null);
}
Calling Linux API functions.
void createHardlink(string from, string to)
{
import fast.cstring : charPtr;
link(charPtr!from, charPtr!to);
}