#pragma once #include template void endianSwap(T *objp) { auto memp = reinterpret_cast(objp); std::reverse(memp, memp + sizeof(T)); }