I am wondering if it is possible in C++11/14 to actually read files at compile time. For example the following code will only compile if it can successfully read the file.>
#define STR(x) #x const char* a = { #include "foo.glsl" };
and foo.glsl should enclose its content in STR( ... )
upd. This will properly handle commas
#define STRINGIFY(...) #__VA_ARGS__ #define STR(...) STRINGIFY(__VA_ARGS__)