
4 Dec
2024
4 Dec
'24
7:12 p.m.
One can manually copy and paste the necessary headers:
https://godbolt.org/z/5Maf9Mx9h
Using a "hash archetype" (a skeleton algorithm that doesn't have any definitions) it seems that MyStruct1 and MyStruct3 generate the exact same code, so it must be inlining shenanigans.
mp_for_each, which the described class code uses, probably adds a few more function calls that push things over some Clang limit.
As a general rule, Clang is more conservative with inlining than GCC is, especially at -O3.
Using ripemd_128, the code remains identical: https://godbolt.org/z/8hTdhT3rq
But adding -DNDEBUG makes a difference: https://godbolt.org/z/d8Ga6eKM4 GCC sees through everything and knocks it out of the park, though. https://godbolt.org/z/YfqKnev49