#ifndef __MLX_BITS__ #define __MLX_BITS__ namespace mlx { template constexpr T ByteSwap(T value) noexcept { static_assert(std::has_unique_object_representations_v, "T may not have padding bits"); auto value_representation = std::bit_cast>(value); std::ranges::reverse(value_representation); return std::bit_cast(value_representation); } } #endif