Yeah the duffs device did it for me too. I remember reading it in some game programming book but shocked to see it used in qt/embedded for it's software rendering.
This is up there for me or there's also that amazing recursive template class for n-dimentional vectorspaces written by Tim Sweeney.
I can't find the page anymore but there is reference to it in the archive https://www.flipcode.com/archives/Unrolling_Loops_With_Meta-...
This is up there for me or there's also that amazing recursive template class for n-dimentional vectorspaces written by Tim Sweeney. I can't find the page anymore but there is reference to it in the archive https://www.flipcode.com/archives/Unrolling_Loops_With_Meta-...