dxml 0.2.0 released

Adrian Matoga dlang.spam at matoga.info
Wed Feb 14 14:02:27 UTC 2018


On Wednesday, 14 February 2018 at 10:57:26 UTC, rikki cattermole 
wrote:
> See lines:
> - Input!IR temp = input;
> - input = temp;
>
>            bool commentLine() {
> 		Input!IR temp = input;
>
> (...)
> 		if (!temp.empty) {
> (...)		
> 			input = temp;
> 			return true;
> 		} else
> 			return false;
> 	}

`temp = input.save` is exactly what you want here, which means 
forward range is required. Your example won't work for range 
objects with reference semantics.


More information about the Digitalmars-d-announce mailing list