CTFE and return statement from delegate
WraithGlade
wraithglade at protonmail.com
Mon Jun 30 19:42:19 UTC 2025
On Monday, 30 June 2025 at 14:22:47 UTC, H. S. Teoh wrote:
> ...
>
> This article may help clear up any misunderstanding that may
> have caused this problem:
>
> https://wiki.dlang.org/Compile-time_vs._compile-time
>
>
> T
That is a wonderful article! I just finished reading it. Thank
you for linking to it.
I wasn't previously aware of that page (being still a beginner
myself) and that article further clarified my mental model of how
D's compile-time features work very effectively.
I would say that anyone using D should definitely read that page
once they've grasped the basics. It touches on some subtle issues
one would otherwise have difficulty discerning.
It especially illuminates the fact that some things derided as D
compiler bugs actually aren't, but are merely subtle.
...
Also, I wasn't aware that `return` isn't allowed in constructors,
as the other person mentioned, so that is good to know too. I
supposed it make sense, since such a `return` may skip some parts
of the construction steps for objects, leaving them in a
corrupted memory state.
More information about the Digitalmars-d-learn
mailing list