[Issue 10394] opBinaryRight!"in" and tuple
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jun 17 16:08:36 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10394
--- Comment #2 from Justin Whear <justin at economicmodeling.com> 2013-06-17 16:08:36 PDT ---
(In reply to comment #1)
> You could use Tuple from std.typecons instead and it will work.
>
> It seems to me what's going on is auto-expansion of a TypeTuple into two
> arguments, and opBinaryRight (or opIn_r) simply can't accept more than one
> argument.
>
> I don't know why that even worked before, it might have been an accepts-invalid
> bug in 2.062 and earlier. Kenji Hara will probably know more.
>From my perspective it'd be somewhat unfortunate to lose the ability to do
this. We make extensive use of "in" as a complement to indexing the same way
associative arrays do: indexing returns the thing or throws if not present
while "in" returns a pointer to the thing or null if not present. Because we
use indexing with multiple "keys" it's nice to have a symmetric way of using
"in".
As for your suggestion to use Tuple, we usually provide an overload for that as
well, particularly because tuples can't be returned from functions.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list