Faced the following function, the author uses it when writing data to a .vtk file. Tell me, what does this feature do?
template <typename T> void SwapEnd(T& var) { char* varArray = reinterpret_cast<char*>(&var); for (long i = 0; i < static_cast<long>(sizeof(var) / 2); i++) std::swap(varArray[sizeof(var) - 1 - i], varArray[i]); }