How to use std::embed in C++?
The std::embed offers a standardized solution for C++ to include bytes of data into the target binary of the program. For an example of bytes of data, we can demonstrate it in the segment of code: byte data[] = { 0x01, 0x02, 0x03, ... }; auto result = process_my_data(data); The problem here is that it's hard to maintain it when the data is large one. Many projects may use a standalone script to convert such a data array from a binary data file at the build stage. The std::embed eliminates such a complexity for us, for example: #include <embed> std::span<byte> data = std::embed("my-data-file.bin"); auto result = process_my_data(data); For more information, please see the published proposal: Published Proposal P1040r6: std::embed