[Issue 7177] $ should forward to length by default
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Mar 21 13:02:42 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=7177
--- Comment #31 from timon.gehr at gmx.ch 2013-03-21 13:02:41 PDT ---
(In reply to comment #24)
> (In reply to comment #22)
> > ...
> > the same reason. As it stands, you pretty much can't use $ in generic code.
> > It's only good for arrays, because you can't count on it working for anything
> > else.
>
> Yes you can, it just requires the range supports $. Define supportsDollar
> trait. Done.
> ...
Needing to state in the template constraint that a type supports syntax sugar
appears to be sub-optimal at best. (Whether or not it is used will usually be
an implementation detail.) IMO adding opDollar using UFCS makes the most sense.
--
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