Source

Thread

1/ @vkrajacic

C macro approach to using optional / default / named function params, using struct designated initializers.
Mandatory values are passed first as standard function params (rect in the example).
Especially useful when a zero value can be made a valid value.

Branches: 2024-01-23-alurmanc-i-love-this, 2024-01-23-alurmanc-shouldnt-it-be-transformarguments-parameters-are, 2024-01-23-MrJayLC-neat, 2024-01-23-DanielcHooper-nice-when-you-combine-this-with-all-the-other, 2024-01-23-endu06-how-does-default-work-do-variable-args-bypass, 2024-01-23-luis_reyes_x-very-cool-designated-initializers-is-one-thing-i, 2024-01-24-falco_girgis-the-only-problem-here-is-that-you-cannot-do-this, 2025-08-13-YehorAvramenko-this-one-is-amazing-to-be-honest, 2025-08-13-peach2k2-really-cool-but-this-doesnt-mean-c-is-a-good-or, 2025-08-13-gretzky00-havent-gotten-to-this-place-i-gotta-keep-pushing, 2025-08-13-heyitsvaishnav-this-is-soo-good-i-did-it-in-typescript-as-well, 2025-08-13-JLakness-c-functor-method, 2025-08-14-emh203-bravo, 2025-08-14-etozheya42-lets-go-10k-likes, 2025-08-14-siddhantCodes-this-is-so-cool, 2025-08-14-EskilSteenberg-am-i-the-only-one-who-thinks-this-is-terrible-its, 2025-08-14-FrawaMudi-honestly-i-dont-know-what-i-am-looking-at-anymore, 2025-08-14-quantized_state-instantly-rewriting-everything, 2025-08-15-k00lagin-i-may-be-just-one-like-but-together-we-build-the, 2025-12-29-CarloIlCugino-thank-you

2/ @pATjako

@vkrajacic

I started experimenting with that in my imgui as well, it is kinda neat, also you can make the same code work for C & C++ (with some limitation in argument ordering)

20 items under this folder.