#include <algorithm.h>
Endian swapping templates note you can specialize any type anywhere in the code if you fell like it.