51#include <seastar/util/modules.hh>
61 static_assert(std::is_trivially_copy_constructible_v<T>);
65 unaligned& operator=(
const T& x)
noexcept { raw = x;
return *
this; }
66 operator T()
const noexcept {
return raw; }
67} __attribute__((packed));
70template <
typename T,
typename F>
71[[deprecated(
"violates strict aliasing rules. See issue #165.")]]
72inline auto unaligned_cast(F* p)
noexcept {
76template <
typename T,
typename F>
77[[deprecated(
"violates strict aliasing rules. See issue #165.")]]
78inline auto unaligned_cast(
const F* p)
noexcept {
79 return reinterpret_cast<const unaligned<std::remove_pointer_t<T>
>*>(p);
Seastar API namespace.
Definition: abort_on_ebadf.hh:26
Definition: unaligned.hh:58