The OpenD Programming Language

hasAsSlice

Checks if type T has asSlice property and its returns a slices. Aliases itself to a dimension count

template hasAsSlice (
T
) {
static if(__traits(hasMember, T, "asSlice"))
enum size_t hasAsSlice;
static if(!(__traits(hasMember, T, "asSlice")))
enum size_t hasAsSlice;
}

Examples

import mir.series;
static assert(!hasAsSlice!(int[]));
static assert(hasAsSlice!(SeriesMap!(int, string)) == 1);

Meta