Thread overview
budding d programmer seeking guidance for an issue
Dec 28, 2019
Yash Bhambhu
Dec 28, 2019
Era Scarecrow
Dec 28, 2019
Era Scarecrow
December 28, 2019
I am working on issue #20412 which is
std.range.pustd.outputrange.put() misbehave s when defined for void[] misbehaves when OutputRange.put(void[] exists)

 I started checking one by one for which case matches for input ranges and output range in put function and concluded that it matches the last if-else statement which is


 else static if (isInputRange!E && is(typeof(put(r, e.front))))


and it then pops front till range is empty which is its expected behavior but when we call put(r,e) it spits out random jargon which cant be in any possible case that comes under the power of put function.
I'm seeking further help and guidance on the same.
December 28, 2019
On Saturday, 28 December 2019 at 20:05:46 UTC, Yash Bhambhu wrote:
> I am working on issue #20412 which is std.range.pustd.outputrange.put() misbehave s when defined for void[] misbehaves when OutputRange.put(void[] exists)


In the case where void[] is passed, could it cast to ubyte[]?

Probably not the answer you're looking for...
December 28, 2019
On Saturday, 28 December 2019 at 20:05:46 UTC, Yash Bhambhu wrote:
> but when we call put(r,e) it spits out random jargon which cant be in any possible case that comes under the power of put function.

 Thinking about it a little further, void would mean it doesn't actually do anything with the array handed to it. So when you try to do _anything_ with void, it is pretty much ignored, meaning you're just getting the results that just happened to be in EAX (or whatever register it would have been working with) at the time.