@r technically that optimization is not specific to tuples, it would treat any type that way. From language feature point of view you can call a function with a tuple as the parameters with std::apply, and if the function returns a tuple you can decompose it in place
auto [x, y] = func();
In general any type can work this way if you make it tuple-like by specializing a couple of standard templates for it. That said the tuple itself is way more powerful and important than any of that syntax sugar.
this post was made by c++ gang (now that has got to be a real gang)
@hyphen @tuxcrafting @fluffy
@hyphen
nothing can beat g++ in slow! It gives you time to think about what you have done, and be ashamed.
I wish I knew mercury, maybe then it would stop calling my code non-deterministic ToT
Anyway GHC stopped doing C transpilation very very early on in its development. It uses its own typed AST representation, then a GHC Core lang (a variant of System FC), then its IR, the STG, which is passed on many times for moar optimization. Then finally the assembly codegen.
Before those transformations there's the parsing and desugaring and type-checking.
Somehow it still manages to compile faster than g++ still xD