Oh, no UFCS for member functions

Luís Marques via Digitalmars-d digitalmars-d at puremagic.com
Tue Mar 29 07:56:53 PDT 2016


Too bad this doesn't work:

struct Player
{
     MapTile[] playerMap; // partial private knowledge of map
     Location destination;

     auto tile(Location loc)
     {
         return playerMap[loc];
     }

     void foo()
     {
         if(destination.tile.hasMonster)
             ...
     }
}


More information about the Digitalmars-d mailing list