join() in CTFE very low performance

realhet real_het at hotmail.com
Sat Jan 4 21:13:11 UTC 2025


On Saturday, 4 January 2025 at 19:54:19 UTC, realhet wrote:
> On Saturday, 4 January 2025 at 15:34:27 UTC, monkyyy wrote:
>> On Saturday, 4 January 2025 at 13:56:47 UTC, realhet wrote:
> Only the very complex stuff works weird in CT -> text, format...

I think I've found the solution, it was so simple, that's why I 
wasn't able to see it :D

```d
mixin template INJECTOR_TEMPLATE(表 table, string script)
{ mixin(script); }
```

The proper way to pass large amount of data through the 
'membrane' of compile-time and run-time is a *mixin template*.

NOT a string mixin combined with the safest and most platform 
independent version of the text() function (for arrays and 
structs).

With the mixin template arguments, the data will always stay in 
binary form, no slow textual form is needed.


It seems like I like to learn the hard way.  But it's so 
difficult to stop thinking with the good old C preprocessor way.  
The classic leg shooting way of thinking is still strong in me :D


More information about the Digitalmars-d-learn mailing list