memesearch
C++ Template Metaprogramming Chaos

C++ Template Metaprogramming Chaos

Download Find similar pictures
Text on the meme
C++ programmers: modern C++ is really nice and readable Also C++ programmers: template <typename... T> requires std::is_same_v<int, T...[0] && requires(T...[0]) { { T...[0]() } -> std::same_as<T...[0]>; } struct S : T...[1] { [no_unique_address] T...[1] base = {}; using foo = T...[1]; S() // : T...[1]() { static_assert(std::is_same_v<int, T...[0]>); const T...[0] f(T...[0] & noexpect(T...[0][0]) { T...[0] (*test)(const volatile T...[0]*); thread_local T...[0] d; [[maybe_unused]] T...[0] a = p; return a; auto ptr = new T...[0](); using Int = int; (*ptr)->T...[0](); return T...[0](); typename T...[1]::foo b = 0; T...[1]::i = 0; return T...[0](a); new T...[0]; new T...[0]*&a); auto l = [](T...[0]>(T...[0][1]) -> T...[0]{return static_cast<T...[0]>(0);}; [[maybe_unused]] auto _ = template operator()<T...[0]>({0}); } operator T...[0]() const{ } }; struct base { using foo = int; static inline int i = 42; }; int main() { S<int, base>().f(0); ///////////// }
What it means

The meme contrasts the claim that modern C++ is readable with an intentionally absurd block of template-heavy code. The joke is that advanced C++ programmers can write syntax so complicated that it becomes nearly impossible to understand. It is commonly sent as a reaction to overengineered code or arguments about C++ simplicity.

Objects
Tags
Sources
Type
image
Size
692×800 · 77.6 KiB
Mood
sarcastic, absurd
Language
en
Added