isNarrowVector

ベクトル型かどうか判定します

enum isNarrowVector (
V
)

Examples

import std.bigint, std.typetuple;
alias TT = TypeTuple!(ubyte, ushort, uint, ulong,
                       byte,  short,  int,  long,
                      float, double, real,
                      creal, cfloat, cdouble/*,*/
                      /*BigInt*/);

static struct M(T, size_t r, size_t c)
{
    enum rows = r;
    enum cols = c;

    auto opIndex(size_t i, size_t j) const { return T.init; }
    alias at = opIndex;
}

foreach(T; TT)
{
    static assert(isNarrowMatrix!(M!(T, 3, 3)));
    static assert(isNarrowMatrix!(M!(const(T), 3, 3)));
    static assert(isNarrowMatrix!(M!(immutable(T), 3, 3)));
    static assert(isMatrix!(M!(T, 3, 3)));
    static assert(isMatrix!(M!(const(T), 3, 3)));
    static assert(isMatrix!(M!(immutable(T), 3, 3)));
}

Meta