Post #1248496
2026-04-06 15:30 UTC
Ep 527 - A clang-tidy Check You NEED To Use! (Designated Initializers)
https://youtu.be/WROn9H5FLoY
Replies (1)
-
@amatan@mastodon.social 2026-04-07 10:57
@lefticus IIUC the designated initializers must come in the order set in the class definition. That is important, to avoid an issue like two members swapping names or position, call sites not updated, and the thing silently compiles. struct human { std::string fname; std::string lname; }; // … // Please err if members swap at defn. return {.fname = “max”, .lname = “low”};