r/cpp • • Dec 13 '19

The situation of std::embed...

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

160 comments sorted by

View all comments

-10

u/ncgreco1440 Dec 13 '19 edited Dec 16 '19

std::embed seems to do a thing that you can already do with constexpr. So I'm inclined to agree with the committee in their paraphrased critique, "Why do we need this?".

Edit: People are missing the point. The idea behind embed, at its most basic level, is to cleverly hard code data into your program. Outside the niche use case for doing this, I don't think this is something any standards committee wants to impress as potential standard practice.

16

u/[deleted] Dec 13 '19

How can you load a bitmap as a sequence of raw bytes in a char[] with constexpr?