Why tuples are not ranges?

Mr.Bingo Bingo at Namo.com
Thu Jun 28 14:35:33 UTC 2018


Seems like it would unify things quite a bit.

import std.typecons, std.range, std.array, std.algorithm, 
std.stdio;

void main()
{
	auto t = tuple(3,4,5,6);
	//auto t = [3,4,5,6];
	
	writeln(t.map!(a => 3*a).sum());
	
	
}


More information about the Digitalmars-d-learn mailing list