Hi Hadriel,

you write that there is no preprocessor support within the f-strings.

 

Is it possible to concatenate preprocessor macro results with preprocessor string concatenation?

If yes, would it be further possible to have the preprocessor preprocess code in its usual way, put it through a STRINGIFY macro and concatenate it into the f string?
 

-----Ursprüngliche Nachricht-----
Von: Hadriel Kaplan via Std-Proposals <std-proposals@lists.isocpp.org>
Gesendet: So 15.10.2023 13:20
Betreff: Re: [std-proposals] Supporting f-strings in C++: draft-R1
An: std-proposals@lists.isocpp.org;
CC: Hadriel Kaplan <hkaplan@juniper.net>;
I've posted a second revision of the draft here: https://tinyurl.com/y7av5tbw

This incorporates some of the feedback, adds some more details, and proposes the two separate types: f-strings and x-strings, with f-string just being sugar for `std::format(X"...")`.

Thanks for the feedback - I think it really improved the proposal.

-hadriel


> From: Hadriel Kaplan <hkaplan@juniper.net>

> OK, then how about compromise-B: two prefixes...
> Let X"" expand this:
>    X"{prefix}_{name}: got {calculate()} for {bits:#06x}"
> To this:
>    "{}_{}: got {} for {:#06x}", prefix, name, calculate(), bits
> And let F"" expand this:
>    F"{prefix}_{name}: got {calculate()} for {bits:#06x}"
> To this:
>    std::format("{}_{}: got {} for {:#06x}", prefix, name, calculate(), bits)
> And obviously we could specify F"" as just being `::std::format(X"")` internally.





Juniper Public
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals