From Jason Turner
Watch on YouTube

Summary

Jason explores two new preprocessor directives coming in C23 and C++23. First, he demonstrates the #embed directive, developed by JeanHeyd Meneide over five years, which provides a clean cross-platform way to embed external resources like files into C/C++ code at compile time. Using Compiler Explorer, he shows how #embed can load both text files and even system resources like /dev/random. Second, he covers the new #warning directive, which offers a standard way to generate compile-time warnings across all compilers, useful for cross-platform code that needs to alert developers about potentially problematic conditions.

Resources

Tags