Added template swapBytes method
This commit is contained in:
parent
8df5440a26
commit
e64d5e5eca
@ -80,6 +80,9 @@ inline void swapBytes16( char* in )
|
|||||||
std::swap(in[7],in[8]);
|
std::swap(in[7],in[8]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void swapBytes(T& t) { swapBytes(reinterpret_cast<char*>(&t), sizeof(T)); }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user