On Tuesday, 5 February 2013 at 01:41:23 UTC, Marco Leise wrote:
Just one note on your Sparky example (from the ASM point of
view): Instead of passing in a pointer to each struct member
(wagTheDog(sparky, sparky.bodi, sparky.bodi.tail);) you could
pass in only 'sparky' as the rest are known offsets from
sparky. It works because it is a POD. If bodi was a reference,
sparky.bodi.tail would still have to be passed in.

I think this is a great optimization, provided Sparky has only one body and only one tail, which may actually be rather easy to verify statically.

Reply via email to