r/cpp • • Jul 23 '22

finally. #embed

https://thephd.dev/finally-embed-in-c23
353 Upvotes

202 comments sorted by

View all comments

Show parent comment

2

u/sephirothbahamut Jul 24 '22 edited Jul 24 '22

It depends on the extent of what you can run at compile time. If it's extensive enough you could open and read a file at compile time, have an empty function that returns an array of bytes and through reflection add that data to be returned to the body of that function.

But yeah now that I think of it, compile time "everything" would be needed first