auto & class members

Robert M. Münch robert.muench at saphirion.com
Sun May 20 14:30:10 UTC 2018


I use the D RX lib [1] and can create a filtered stream using the auto keyword:

struct a {
	SubjectObject!myType myStream;
	??? mySubStream;
}

void myfunc(){
	a myA = new a();

	auto mySubStream = a.myStream.filter!(a => a == myMessage);
	...
}

The problem is, that I don't find out what the type of mySubStream is, 
which I would like to make a member of the struct, so that I can 
reference it outside the function too.

How can I find out the type of an auto? This here seems to be a pretty 
complicated templated, nested type, whatever result.

[1] https://github.com/lempiji/rx

-- 
Robert M. Münch
http://www.saphirion.com
smarter | better | faster



More information about the Digitalmars-d-learn mailing list