Re: Referencer

2015-11-23 Thread HaraldZealot via Digitalmars-d
for out-range even is more important. So I'm found myself at fork point which from my next work for community is better: * add support for out range in `RefRange` * or implement further my universal referencer?

Re: Referencer

2015-11-23 Thread Jonathan M Davis via Digitalmars-d
doesn't work with out-range :( Ridiculous, because reference semantic for out-range even is more important. So I'm found myself at fork point which from my next work for community is better: * add support for out range in `RefRange` * or implement further my universal referencer? RefRange

Re: Referencer

2015-11-23 Thread HaraldZealot via Digitalmars-d
that anything accepting an output range should accept it by ref. So, you see that to open a PR about changes _by value_ to _by ref_ semantic for all functions operate with out range (especially for copy) is better way? But this breaks existing API... Certainly, I would think that your Referencer

Re: Referencer

2015-11-23 Thread HaraldZealot via Digitalmars-d
On Monday, 23 November 2015 at 15:35:32 UTC, Jonathan M Davis wrote: Well, if all you want is to get a reference type out of a value type, then putting it on the heap and using a pointer to it would be a solution. Using RefCounted would be another, and I would think that it would be similar

Re: Referencer

2015-11-23 Thread Jonathan M Davis via Digitalmars-d
them). In any case, no, you probably shouldn't just start creating PRs which put ref on various output range parameters in Phobos. Certainly, I would think that your Referencer type is going in the wrong direction, because it's declaring a bunch of functions that have nothing to do

Re: Referencer

2015-11-21 Thread Kagamin via Digitalmars-d
On Friday, 20 November 2015 at 18:48:51 UTC, Alex Parrill wrote: * I wouldn't mark this struct as @safe because the passed value may leave scope, causing invalid dereferences. Interestingly, it's not enough to not mark it as safe: the templated methods will still be inferred as @safe. At last

Re: Referencer

2015-11-20 Thread Alex Parrill via Digitalmars-d
On Friday, 20 November 2015 at 18:23:57 UTC, HaraldZealot wrote: All ranges in Phobos pass by value, but if I have output range with state like cumulative statistics this is useless. After discussion with Dicebot I try this work-arround: http://dpaste.dzfl.pl/8af8eb8d0007 It is unfinished.

Referencer

2015-11-20 Thread HaraldZealot via Digitalmars-d
All ranges in Phobos pass by value, but if I have output range with state like cumulative statistics this is useless. After discussion with Dicebot I try this work-arround: http://dpaste.dzfl.pl/8af8eb8d0007 It is unfinished. But direction is observable. Is this good solution? And how about

Re: Referencer

2015-11-20 Thread Jonathan M Davis via Digitalmars-d
On Friday, 20 November 2015 at 18:23:57 UTC, HaraldZealot wrote: All ranges in Phobos pass by value, but if I have output range with state like cumulative statistics this is useless. Realistically, output ranges really should be passed by ref, but I'm not sure whether that's really being done

Re: Referencer

2015-11-20 Thread HaraldZealot via Digitalmars-d
On Friday, 20 November 2015 at 18:48:51 UTC, Alex Parrill wrote: On Friday, 20 November 2015 at 18:23:57 UTC, HaraldZealot wrote: I'm not sure how useful this is as opposed to plain pointers. For structs, since `foo.bar` is the same as `().bar`, you may as well use a pointer, and the only