Elektrine lite

← Feed

@amatan@mastodon.social

Post #1656953

2026-04-07 10:57 UTC

@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”};

Replies (1)