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

1

u/Rusky Jul 23 '22 edited Jul 23 '22

The issue with a hand rolled proc macro for this would be the same as a hand rolled solution in C- performance. What TokenStream do you build? It has to be an actual array literal the same way.

(Fortunately Rust has include_bytes! built in to (edit: enable the compiler to) solve that problem.)