String Interpolation Compare - DIP1027 and YAIDIP
Walter Bright
newshound2 at digitalmars.com
Sat Oct 21 04:17:57 UTC 2023
On 10/20/2023 8:51 PM, Steven Schveighoffer wrote:
> How can you possibly think that YAIDIP requires allocations?
How else can you make a user-defined dec() work?
> The only proposal
> that requires allocations is DIP1027, since you must rebuild the format string
> if your function doesn't support printf style format specifiers (i.e. mysql).
The example I gave in the other thread shows how to not need to rewrite the
format string.
https://www.digitalmars.com/d/archives/digitalmars/D/Just_another_example_of_missing_string_interpolation_370542.html#N370696
But even if you did rewrite it, it doesn't escape the template function, and can
be RAII'd.
Dealing with a string allocated and returned by `dec()` is significantly harder.
More information about the Digitalmars-d
mailing list