Closed ScruffR closed 4 years ago
@ScruffR, the question is why does the swap macro cause issues? It would be very simple to wrap the definition like this:
#ifndef swap
#define swap(a, b) { int16_t t = a; a = b; b = t; }
#endif
Could you this that a shot?
The problem seems to be that once swap
is defined as macro, the swap
function in std::vector
and other std::
containers is hidden by the macro.
On the other hand, if I flip the includes round, any call to vector::swap
results in an error.
So the only way around this is to rename the swap macro or limit its lifetime to the GFX library only.
BTW, the same issue is presend with the Adafruit_GFX lib.
Then perhaps the best solution is to change swap to swapBytes or something similar.
Yup, that'd help
Do you want to do a PR? Otherwise, I'll get to it this weekend.
I'll see how my home schedule looks like this weekend ;-)
That macro makes the use of several std:: classes rather difficult.
This rather simple test throws a load of errors all in
std::vector
Sure
#undef swap
does fix that, but still ;-)