Auto field member?

Hanh via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Mar 1 18:50:15 PST 2016


Hi,

Is there a way to declare a class field 'auto'? I have a problem 
when I try to 'promote' a variable to a field.

import std.csv;
import std.typecons;

class Test {
	this() {
		auto text = "Joe,Carpenter,300000\nFred,Blacksmith,400000\r\n";
     	        auto reader = csvReader!(Tuple!(string, string, 
int))(text); // how to make this a field?
     }
}

csvReader returns a private type so I can't specify the type 
explicitly.

Thanks,
--h




More information about the Digitalmars-d-learn mailing list