use of typeof to determine auto type with ndslice examples

Jay Norwood via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Dec 20 22:09:02 PST 2015


So, the extra confusion of the typeof(iota) Result return goes 
away when slicing arrays.

	auto a1 = new int[100];
	auto t3 = a1.sliced(3,4,5);
	pragma(msg,typeof(t3)); //This prints Slice!(3u, int*)
	Slice!(3u, int*) t4 = a1.sliced(3,4,5); // and this works ok


More information about the Digitalmars-d-learn mailing list