Add an overload of endian_reverse_inplace for arrays

This commit is contained in:
Peter Dimov
2020-05-05 20:06:21 +03:00
parent a6e1da6a79
commit 62091e5d0c
3 changed files with 83 additions and 0 deletions
@@ -161,6 +161,17 @@ template<class T> inline
x = endian_reverse( x );
}
// endian_reverse_inplace for arrays
template<class T, std::size_t N>
inline void endian_reverse_inplace( T (&x)[ N ] )
{
for( std::size_t i = 0; i < N; ++i )
{
endian_reverse_inplace( x[i] );
}
}
} // namespace endian
} // namespace boost