D metaclass stuff vs C++23

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon May 13 11:01:07 UTC 2019


On 5/13/19 10:06 AM, Russel Winder wrote:
> Hi,
> 
> In the "show what can be done, not what should be done" category,
> someone has done a C++ version of Hello World using the up-coming
> metaclass stuff:
> 
> https://twitter.com/Cor3ntin/status/1127210941718962177
> 
> I immediately (once I knew about it) replied with the Python version:
> 
> https://twitter.com/russel_winder/status/1127859587393163265
> 
> 
>     class Hello: pass
> 
>     World = None
> 
>     if __name__ == '__main__':
>         print(" ".join([item for item in dir() if not item.startswith("_")]))
> 
> 
> but clearly a better competitor would be a D version. Anyone done this
> sort of thing, i.e. compile time metaclass manipulation?

I replied with a no-brainer equivalent.



More information about the Digitalmars-d mailing list