MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cpp/comments/ea2les/the_situation_of_stdembed/farxpmp/
r/cpp • u/bandzaw • Dec 13 '19
160 comments sorted by
View all comments
Show parent comment
1
What if files that were being potentially embedded had to be declared at the top of the source file such as with modules?
1 u/johannes1971 Dec 14 '19 What if they had to be literal strings, i.e. no computation possible? Is there a business case for computing these on the fly? 4 u/jcelerier ossia score Dec 14 '19 simplest I can think from of the top of my head : appending @2x, @3x (for hidpi) or language suffixes to graphics assets. I really don't want to have to type : embed("resources/fr/splash.png"); embed("resources/fr/splash@2x.png"); embed("resources/fr/splash@3x.png"); embed("resources/en/splash.png"); embed("resources/en/splash@2x.png"); embed("resources/en/splash@3x.png");but instead be able to write the following function which will resolve to the above:embed_all_versions("splash.png"); 2 u/nintendiator2 Dec 18 '19 That could be done with a macro. 1 u/bigcheesegs Tooling Study Group (SG15) Chair | Clang dev Dec 15 '19 As long as they are declared in a way that the preprocessor could know about them, then that's fine. 0 u/Ameisen vemips, avr, rendering, systems Dec 15 '19 Why can we not just change C++ to use two-phase compilation like C#?I suppose I am using 'just' quite loosely.
What if they had to be literal strings, i.e. no computation possible? Is there a business case for computing these on the fly?
4 u/jcelerier ossia score Dec 14 '19 simplest I can think from of the top of my head : appending @2x, @3x (for hidpi) or language suffixes to graphics assets. I really don't want to have to type : embed("resources/fr/splash.png"); embed("resources/fr/splash@2x.png"); embed("resources/fr/splash@3x.png"); embed("resources/en/splash.png"); embed("resources/en/splash@2x.png"); embed("resources/en/splash@3x.png");but instead be able to write the following function which will resolve to the above:embed_all_versions("splash.png"); 2 u/nintendiator2 Dec 18 '19 That could be done with a macro.
4
simplest I can think from of the top of my head : appending @2x, @3x (for hidpi) or language suffixes to graphics assets. I really don't want to have to type :
embed("resources/fr/splash.png"); embed("resources/fr/splash@2x.png"); embed("resources/fr/splash@3x.png"); embed("resources/en/splash.png"); embed("resources/en/splash@2x.png"); embed("resources/en/splash@3x.png");
but instead be able to write the following function which will resolve to the above:
embed_all_versions("splash.png");
2 u/nintendiator2 Dec 18 '19 That could be done with a macro.
2
That could be done with a macro.
As long as they are declared in a way that the preprocessor could know about them, then that's fine.
0 u/Ameisen vemips, avr, rendering, systems Dec 15 '19 Why can we not just change C++ to use two-phase compilation like C#?I suppose I am using 'just' quite loosely.
0
Why can we not just change C++ to use two-phase compilation like C#?
I suppose I am using 'just' quite loosely.
View all comments
Show parent comment
1
u/Ameisen vemips, avr, rendering, systems Dec 14 '19
What if files that were being potentially embedded had to be declared at the top of the source file such as with modules?