From e64d5e5ecafcb32443d1e1fda54ad00c6366f79a Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 7 Dec 2012 19:04:49 +0000 Subject: [PATCH] Added template swapBytes method --- include/osg/Endian | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/osg/Endian b/include/osg/Endian index 3e3934f7b..b35155894 100644 --- a/include/osg/Endian +++ b/include/osg/Endian @@ -80,6 +80,9 @@ inline void swapBytes16( char* in ) std::swap(in[7],in[8]); } +template +void swapBytes(T& t) { swapBytes(reinterpret_cast(&t), sizeof(T)); } + } #endif