Thoughts on improving operators

Vladimir Panteleev vladimir at thecybershadow.net
Wed Oct 5 03:54:37 PDT 2011


On Wed, 05 Oct 2011 13:26:26 +0300, Gor Gyolchanyan  
<gor.f.gyolchanyan at gmail.com> wrote:

> Example: named foreach loops over objects:

You can achieve almost exactly this by iterating over a delegate (define a  
method with the same signature as opApply). The only change at the call  
site is that instead of "foreach(ref c; ts.text)" you'll type "foreach(ref  
c; &ts.text)".

-- 
Best regards,
  Vladimir                            mailto:vladimir at thecybershadow.net


More information about the Digitalmars-d mailing list