last day (15 days later) » 

14:54
@Incomputable hi
the problem with behaving like an iterator lies in expensiveness of computing the distance, end iterator
@hoffmale, hi, thanks for joining
Well, that's always the problem with infinte ranges
they are infinite
it is unfortunate that standard library doesn't support sentinel values yet
Most range libraries (like the ranges v3 one) have some kind of limiter function, though
I thought about following the range interface, but creating something like a merger
14:57
e.g. only take up to n elements from the range
I think that it is important to separate check for past-the-end from iteration, thus something like std::xxx_n functions won't need to pay for the checks
@hoffmale I guess I should've read about them before writing the code
Eric Niebler did a talk some years ago about the ideas behind his ranges library
in there, he showed a calendar display using infinite ranges
@hoffmale I believe I watched it on cppcon, but it looked like a wall of code
yeah ^^ that one
the output looked nice though
I thought about adding ability to not advance the range with the value retrieval, but then I thought that ranges might get out of sync
which is probably not desired
15:03
"to not advance the range"
what do you mean by that?
oh, the current iterator
sorry, I've caught an illness, I might make mistakes from time to time
at least more often than usual :)
Oh, I get it
I was confused for a bit
Because ranges by themselves are just a pair of iterators, and the same two iterators can be requested as often as needed
15:33
@Incomputable just saw I forgot to put the usage example on godbolt
Here's it in executable form
I commented those template restrictions, because MSVC wouldn't compile it otherwise <.<
@hoffmale thanks, that looks neat. I'll try to put more effort into encorporating existing iterator interface
IIRC latest VC++ should handle it
lemme check
it compiles well
try to update the VS, they push changes quite often
Hmm... looks like it didn't like the value_type type alias in the std::is_constructible_v part
replacing it with typename std::iterator_traits<Iterator>::value_type there fixed it
the code is certainly correct, so I guess it is just a problem with older VC++
I've got work to do, sorry, I'll come back when I'll have some ideas about improving the interface
Sure ^^

last day (15 days later) »