[Issue 16034] map should be possible with a reference only

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu May 19 04:39:07 PDT 2016


ZombineDev <petar.p.kirov at gmail.com> changed:

           What    |Removed                     |Added
                 CC|                            |petar.p.kirov at gmail.com

--- Comment #2 from ZombineDev <petar.p.kirov at gmail.com> ---
IMO, the language limitation that ref is not part of the type (but is instead
only a storage class), prevents making ranges work (among other things) work
with non-copyable types.
If that wasn't the case ElementType!(One[]) could return ref(One), and you
could use map with a lambda whose paramter is ref(One).


More information about the Digitalmars-d-bugs mailing list