EntityRange.SliceOfR

The type used when any slice of the original input is used. If R is a string or supports slicing, then SliceOfR is the same as R; otherwise, it's the result of calling $(PHOBOS_REF takeExactly, std, range) on the input.

import std.algorithm : filter;
import std.range : takeExactly;

static assert(is(EntityRange!(Config.init, string).SliceOfR == string));

auto range = filter!(a => true)("some xml");

static assert(is(EntityRange!(Config.init, typeof(range)).SliceOfR ==
                 typeof(takeExactly(range, 42))));
  1. alias SliceOfR = R
    struct EntityRange(Config cfg, R)
    static if(isDynamicArray!R || hasSlicing!R)
    alias SliceOfR = R
  2. alias SliceOfR = typeof(takeExactly(R.init, 42))

Meta