memesearch
C++ Runs Out of Syntax

C++ Runs Out of Syntax

Download Find similar pictures
Text on the meme
struct Range { int lo, hi; }; struct Config { [[=Range{lo: 1, hi: 65535}]] int port; [[=Range{lo: 1, hi: 256}]] int max_threads; [[=Range{lo: 100, hi: 30000}]] int timeout_ms; }; template <typename T> constexpr bool validate(const T& obj) { constexpr auto context = std::meta::access_context::current(); template for (constexpr auto member : define_static_array( r: nonstatic_data_members_of(^T, context))) { template for (constexpr auto annotation : define_static_array( annotations_of_with_type(member, ^^Range))) { auto [lo, hi] = extract<Range>(annotation); if (obj.@[member] < lo || obj.@[member] > hi) return false; } } return true; } static_assert(validate(Config{port: 1000, max_threads: 50, timeout_ms: 20000})); static_assert(!validate(Config{port: 0, max_threads: 0, timeout_ms: 0})); C++ HAS OFFICIALLY RUN OUT OF SYNTAX
What it means

A C++ logo appears beside a dark screen filled with highly complex C++ template code. Large text declares that C++ has officially run out of syntax, joking that the language has become absurdly complicated and unreadable. The meme is used as a reaction to bizarre, overengineered, or intimidating C++ syntax. EN: A C++ logo appears beside a dark screen filled with highly complex C++ template code. Large text declares that C++ has officially run out of syntax, joking that the language has become absurdly complicated and unreadable. The meme is used as a reaction to bizarre, overengineered, or intimidating C++ syntax.

Objects
Tags
Source
Type
image
Size
800×800 · 110.5 KiB
Mood
sarcastic, absurd
Language
en
Added