Next in Review Queue: The New std.path

bearophile bearophileHUGS at lycos.com
Thu Jul 14 18:00:26 PDT 2011


Just few comments to the source code. I have not used it yet.

version (Windows) private alias Signed!size_t ssize_t;

Why not just ptrdiff_t ?

-------------------

In theory this too is (in C[] path) but I presume you have found troubles:
private C[] chompDirSeparators(C)(C[] path)  @safe pure nothrow

-------------------

So here you have had to use Unqual
immutable(Unqual!C1)[] setExtension(C1, C2)(in C1[] path, in C2[] ext)
immutable(Unqual!C1)[] defaultExtension(C1, C2)(in C1[] path, in C2[] ext)

Instead of Unqual isn't it nicer to use a Deconst!() template?

-------------------

// Detects whether the given types are all string types of the same width
private template Strings...)  if (Strings.length > 0)

I think that a CTFE function with a static foreach is better/faster/simpler than the recursive compatibleStrings() template.

-------------------

unittest
{

I suggest to add a comment that tells what function/class/struct is tested in this unittest (this is a poor's man named unittest).

Bye,
bearophile


More information about the Digitalmars-d mailing list