[Issue 8494] Return value for Tuple.opAssign

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Aug 29 02:48:45 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=8494

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

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

--- Comment #3 from ZombineDev <petar.p.kirov at gmail.com> ---
You're misunderstanding the OP. The whole point of this enhancement request is
to make T and Tuple!T interchangeable. Changing the return type of `bar` misses
the point completely. Essentially what this OP is asking is:
1. Tuple.opAssign should return `this` (the object being modified)
2. Tuple!T should implicitly convert to T.

This comes from a higher-level goal that type constructors should be
indistinguishable from built-in types - there should be nothing that
user-defined can't do, that a built-in type can. 

Razvan, please refrain from closing valid enhancement requests. 1-2 years ago
bearophile was one of the most active community members and many of his ideas
helped shape the language and the standard library. While some of his
enhancement request are a bit vague and not always clear, quite often there are
good ideas in there. In particular, a future proposal for built-in tuples may
greatly benefit from many of his litmus tests.

--


More information about the Digitalmars-d-bugs mailing list