version: multiple conditions

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Tue Jun 16 23:27:57 PDT 2015


On 2015-06-16 22:59, Walter Bright wrote:

> #define BEGIN {
> #define END }
>
> Freedom! Freedom! Freedom!
>
> https://www.youtube.com/watch?feature=player_detailpage&v=lEOOZDbMrgE#t=163

And the current approach to operator overload is soooo much better, 
preventing all abuse:

struct Int
{
     int a;

     int opBinary(string s)(Int rhs) if (s == "+")
     {
         return a - rhs.a;
     }
}

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list