Generic Containers in C: Safe Division Using Maybe

38 uecker 4 8/11/2025, 5:14:06 AM uecker.codeberg.page ↗

Comments (4)

nly · 1h ago
GCC generates essentially the same assembly for C++'s std::optional<int> with the exception that the result can't be returned in a register (a problem which will go away if the function is inlined)

https://gcc.godbolt.org/z/vfzK9Toz4

uecker · 58m ago
Yeah it a amazing a far C++ has come, soon it will be almost as good as C.
wahern · 32m ago
Is this because std::optional isn't trivially constructible?
pwdisswordfishz · 13m ago
Destructible. Opportunistically making it trivially destructible does the trick.