Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RByteSwap< N > Struct Template Reference

template<unsigned N>
struct RByteSwap< N >

Helper templated class for swapping bytes; specializations for N={2,4,8} are provided below.

This class can be used to byteswap any other type, e.g. in a templated function (see example below).

template <typename T>
void byteswap_arg(T &x) {
using value_type = typename RByteSwap<sizeof(T)>::value_type;
x = RByteSwap<sizeof(T)>::bswap(reinterpret_cast<value_type>(x));
}
Double_t x[n]
Definition legend1.C:17
Helper templated class for swapping bytes; specializations for N={2,4,8} are provided below.
Definition Byteswap.h:124

Definition at line 124 of file Byteswap.h.

#include <Byteswap.h>


The documentation for this struct was generated from the following file: