Added template swapBytes method

This commit is contained in:
Robert Osfield 2012-12-07 19:04:49 +00:00
parent 8df5440a26
commit e64d5e5eca

View File

@ -80,6 +80,9 @@ inline void swapBytes16( char* in )
std::swap(in[7],in[8]);
}
template<typename T>
void swapBytes(T& t) { swapBytes(reinterpret_cast<char*>(&t), sizeof(T)); }
}
#endif