New operators opStaticIndex and friends

Simen Kjærås simen.kjaras at gmail.com
Wed May 15 09:05:20 UTC 2019


On Wednesday, 15 May 2019 at 01:42:57 UTC, Exil wrote:
> Does it need to be called opStaticIndex? Could it just be 
> called opIndex and require the specific template arguments. If 
> you define opIndex(int)() now, it will never be called right 
> (unless you specifically invoke it)?

Correct. But opIndex(T...)(Foo!T t) may be, and could then be 
called as either

     s[0](Foo!0.init)

or

     s[Foo!0.init]

Not sure if this is a big issue, but it's at least indicative of 
possible other issues.

--
   Simen


More information about the Digitalmars-d mailing list