opDispatch with string mixin does not work as I would expect.

Boris-Barboris ismailsiege at gmail.com
Sat Feb 10 07:47:30 UTC 2018


On Saturday, 10 February 2018 at 06:32:43 UTC, German Diago wrote:
> The mixin line does not work. I want to generate the access to 
> the field. How could I achieve that?


struct Outer
{
	struct Inner
	{
		int a;
		float b;
	}
	Inner i;
	
	auto opDispatch(string name)()
	{
		return __traits(getMember, i, name);
	}
}



More information about the Digitalmars-d-learn mailing list