Function Subspace :: sus :: mem :: size_of

template <class T>
auto size_of() -> size_t
requires
!std::is_reference_v<T>

Returns the size of the type T.

This is the number of bytes that will be allocated for a type T, and includes any tail padding. Use data_size_of to exclude tail padding for the purpose of memcpy or sus::ptr::copy.

Returns the same value as the builtin sizeof operator, but disallows calls with a reference type to avoid surprises or bugs when working with references since sizeof(T&) == sizeof(T).