Idiomatic way to write a range that tracks how much it consumes
drug2004 at bk.ru
Mon Apr 27 04:41:58 UTC 2020
27.04.2020 06:38, Jon Degenhardt пишет:
> Is there a better way to write this?
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 paradigms.
Considering you need amount of consumed bytes only when range is empty
the second way is more effective.
More information about the Digitalmars-d-learn