Path.toHash

Compute hash of the Path to be able to use it as key in asociative arrays.

struct Path
@safe nothrow const
size_t
toHash
()

Examples

import dshould;

string[Path] arr;
arr[Path("my", "path")] = "hello";
arr[Path("w", "42")] = "world";

arr[Path("my", "path")].should.equal("hello");
arr[Path("w", "42")].should.equal("world");

import core.exception: RangeError;
arr[Path("x", "124")].should.throwA!RangeError;

Meta