Range with an alias parameter
Alex
sascha.orlov at gmail.com
Wed Jan 30 20:13:56 UTC 2019
Given this:
´´´
import std.experimental.all;
void main(){}
static assert(isInputRange!(ReturnType!(produceS!(42))[]));
auto produceS(size_t param)() { return S!param(); }
struct S(size_t param)
{
//@disable this(this);
auto opIndex() { return produceRange!(this); }
}
auto produceRange(alias source)(){ return Range!source(); }
struct Range(alias source)
{
size_t front();
void popFront();
bool empty();
}
´´´
Why disabling copying of S removes the range property of Range?
More information about the Digitalmars-d-learn
mailing list