On Monday, 27 April 2020 at 05:06:21 UTC, anon wrote:
To implement your option A you could simply use
std.range.enumerate.
Would something like this work?
import std.algorithm.iteration : map;
import std.algorithm.searching : until;
import std.range : tee;
size_t bytesConsumed;
auto result =
On Monday, 27 April 2020 at 04:51:54 UTC, Steven Schveighoffer
wrote:
On 4/26/20 11:38 PM, Jon Degenhardt wrote:
Is there a better way to write this?
I had exactly the same problems. I created this to solve the
problem, I've barely tested it, but I plan to use it with all
my parsing utilitie
On Monday, 27 April 2020 at 04:41:58 UTC, drug wrote:
27.04.2020 06:38, Jon Degenhardt пишет:
Is there a better way to write this?
--Jon
I don't know a better way, I think you enlist all possible ways
- get a value using either `front` or special range member. I
prefer the second variant,
To implement your option A you could simply use
std.range.enumerate.
Would something like this work?
import std.algorithm.iteration : map;
import std.algorithm.searching : until;
import std.range : tee;
size_t bytesConsumed;
auto result = input.map!(a => a.yourTransformation )
On 4/26/20 11:38 PM, Jon Degenhardt wrote:
I have a string that contains a sequence of elements, then a terminator
character, followed by a different sequence of elements (of a different
type).
I want to create an input range that traverses the initial sequence.
This is easy enough. But after
27.04.2020 06:38, Jon Degenhardt пишет:
Is there a better way to write this?
--Jon
I don't know a better way, I think you enlist all possible ways - get a
value using either `front` or special range member. I prefer the second
variant, I don't think it is less consistent with range paradigm
I have a string that contains a sequence of elements, then a
terminator character, followed by a different sequence of
elements (of a different type).
I want to create an input range that traverses the initial
sequence. This is easy enough. But after the initial sequence has
been traversed, t