I'm using C++ 14. I need a way to specialize calls to memcpy(), so that they become just an integer set operation if they are 2, 4, 8, or 16 bytes long.
For instance, 'memcpy(a, b, 4)' should compile to 'mymemcpy<4>(a,b)' , but something like 'int c = 7+1; memcpy(a, b, c);' should compile to the original memcpy(a, b, c). Using macros or templates is fine.
I tried with constexpr, but that wasn't a good result.