Binary Serialize
|
This is an implementation of the C++ 23 std::byteswap
function, for use in pre C++ 23 applications.
More...
#include <concepts>
#include <bit>
#include <array>
#include <cstddef>
#include <algorithm>
Go to the source code of this file.
Functions | |
template<std::integral T> | |
constexpr T | chops::byteswap (T value) noexcept |
Perform an in-place byte swap on an integral type (if size of the type is greater than one). | |
This is an implementation of the C++ 23 std::byteswap
function, for use in pre C++ 23 applications.
This implementation is taken directly from the CPP Reference page: https://en.cppreference.com/w/cpp/numeric/byteswap
Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
constexprnoexcept |
Perform an in-place byte swap on an integral type (if size of the type is greater than one).
T | Type of value where swapping will occur. |
value | Integral value to be byte swapped. |