alias this and constructor

Jack Applegame japplegame at gmail.com
Sat Apr 12 04:48:34 PDT 2014


Why this code doesn't want to compile?

import std.algorithm;
import std.array;

struct Foo {
	int a;
	this(int v) {}
	alias a this;
}

void main() {
	immutable(Foo)[] foo;
	auto arr = array(foo.filter!(o => true));
}

http://dpaste.dzfl.pl/25572b0f6d0b



More information about the Digitalmars-d-learn mailing list