The problem that took him 5 years to fix in C++, I solved in a minute with D

Paul Backus snarwin at gmail.com
Thu Mar 10 11:52:36 UTC 2022


On Thursday, 10 March 2022 at 02:01:01 UTC, matheus wrote:
> Hi,
>
> Today someone sent me this video: 
> https://www.youtube.com/embed/ABg4_EV5L3w
> (C++ Weekly - Ep 313 - The `constexpr` Problem That Took Me 5 
> Years To Fix!).
>
> It's a 26 minute long video of a guy trying to generate a 
> concatenated string during CT in C++.
>
> I was flabbergasted by the problems this poor guy had in front 
> of him for a thing that shouldn't seem so complex (In my 
> opinion of course). And more yet that he has being struggling 
> with this for 5 years.

Reminds me of this CppCon talk by Andrei Alexandrescu that was 
posted in the community Discord recently:

https://youtu.be/va9I2qivBOA

Once you get through all of the background material in the first 
half, the payoff is...a bunch of clever workarounds for the fact 
that C++ doesn't have static foreach.

Of course, Andrei knows this--one of his early slides even says, 
"static for needed for simple implementation". But evidently the 
C++ committee has not yet been convinced.


More information about the Digitalmars-d mailing list