Use .get() in MultiD Assoc Array?

Paul phshaffer at gmail.com
Thu Sep 6 14:05:17 PDT 2012


On Saturday, 1 September 2012 at 05:23:35 UTC, Ali Çehreli wrote:
> On 08/31/2012 11:55 AM, Ali Çehreli wrote:
>
> > class MyTable
>
> [...]
>
> > // Enables the 'auto element = myIndex in myTable' syntax
>
> That's wrong. For that syntax to work, the operator below 
> should have been opBinaryRight.
>
> > string * opBinary(string op)(Index index)
>
> Yeah, that should have been opBinaryRight.
>
> (And the badly designed Thunderbird removes the indentation in 
> quoted text. Smart application or stupid designer?)
>
> > // Enables 'auto value = myTable[myIndex]'
> > ref string opIndex(Index index)
> > {
> > string * result = this.opBinary!"in"(index);
>
> If I had defined opBinaryRight as I should have, then I could 
> simply use the 'in' operator on the right-hand side:
>
>         string * result = index in this;
>
> > Ali
>
> Ali
> "too"

Ali I am grateful for your help but its over my head...at least 
at present.  Thanks.


More information about the Digitalmars-d-learn mailing list