PathMatchResult.opCast

Converts the result to a boolean value. This is synonymous to matches.

struct PathMatchResult
const
T
opCast
(
T : bool
)
()

Return Value

Type: T

True, if the pattern matches the pattern.

Examples

if (auto match = matchPath("/path", "/:name")) {
    assert(match.getPathParam("name") == "path");
}
else {
    assert(false);
}

if (auto match = matchPath("/path", "/no-match")) {
    assert(false);
}

Meta