https://jadlevesque.github.io/PPMP-Iceberg/ The Preprocessor Iceberg Meme Preprocessor metaprogramming knowledge obscurity chart contributors: JadLevesque notfoundry camel-cdr Based on Blackle Mori's (@suricrasia) The Cursed Computer Iceberg Meme Above the iceberg * #include * macros just replace text * header guards * #if #elif * make sure to parenthesize arguments * #pragma onceextension * do { } while (0) * ARRAY_LEN() On the iceberg * macros expansion isn't recursive * #a * a##b * __VA_ARGS__ * #undef * #error * defined is unary * physical vs logical source lines * X macros Below the water * __FILE__ __LINE__ * __DATE__ __TIME__ * Trigraph * #line * function like macros only see parentheses * __VA_OPT__C++20 and extension * #define A(x...)extension * ,##__VA_ARGS__extension * #pragma _Pragma() * -P -Enot standardized * #if static_cast(-1) * preprocessing directives can't be inside of macros Middle of the iceberg * __COUNTER__extension * prefix namespaces * stringify macros * #define CAT(a,b) CAT_(a,b) #define CAT_(a,b) a##b * __has_includeC++17 * #elifdef #elifndefC2x * #embedC2x proposal * SCAN() * no more than 4095 * mcpp * overloading macros based on argument count * default arguments Bottom of the iceberg * Microsoft took 30 years to implement a standard compliant preprocessor * no argument means one argument * blue paint * CHECK() * saturated overloading * INC()/DEC() * EVAL()/DEFER() * Boost preprocessor Below the iceberg * list datastructure * #2""3extension * lazy P arguments * C89 CHECK() * pp-num prefix * lazy arguments without Pextension * #assertextension * #include_nextextension * IS_EMPTY() * ppstep * sequence datastructure * OBJECT disabling context Deep water * A(1)(2)(3)(4)(5) * order-pp * chaos-pp * Metalang99 * Continuation machine * macro stack * interpreters/compilers * language extensions * binary search SCAN * O(1) random access memory * __COUNTER__ resetextension * #include __DATE__ * integer arithmetics The abyss * SIMD/SCMD * ICE_P()C11 * macro expansion can be recursiveextension * #include custom filesystem * F(x,y)y)y)y)y) * #for #endforrejected C proposal * operator overloading * tcc's magic non recursive recursive sequence iterationcompiler specific * slots * file iteration * file stackextension * file stack line accumulator