On Tue, May 03, 2022 at 04:38:23PM +0000, cc via Digitalmars-d-learn wrote:
> On Tuesday, 3 May 2022 at 15:08:53 UTC, H. S. Teoh wrote:
> >     class Base : Serializable!(Base) { ... }
> >     class Derived : Serializable!(Base, Derived) { ... }
> 
> This is really interesting syntax, I'm surprised that works!

https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern

It's a bit counterintuitive at first, but once you "get" how it works,
it's an extremely powerful technique for leveraging D's compile-time
introspection capabilities. And translating compile-time information
into runtime using static this(). ;-)


T

-- 
Never step over a puddle, always step around it. Chances are that whatever made 
it is still dripping.

Reply via email to