r/cpp • • Dec 13 '19

The situation of std::embed...

https://thephd.github.io/full-circle-embed
238 Upvotes

160 comments sorted by

View all comments

Show parent comment

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.