Traits mega template
Per Nordlöw
per.nordlow at gmail.com
Sun Aug 10 16:20:49 UTC 2025
On Saturday, 9 August 2025 at 17:16:21 UTC, monkyyy wrote:
> would a single mega template lib of traits bullshit be more
> wildly more compile time and usable efficient then phoboes
> isBlahBlahBlah?
> when a isBidirectionalRange || isRandomAccess range is called,
All of Phobos's traits should be transcoded to builtin __traits
for performance reasons. Using templates to implement traits is
an anti-pattern both in D and C++ as templates are too costly and
design for this purpose. This is how C++ does it. The C++
standard makes this a requirement for compiler implementations.
The reason is performance. Until D has type functions that is.
More information about the Digitalmars-d
mailing list