Why Nostr? What is Njump?
2023-06-21 17:37:21
in reply to

Coyote on Nostr: Fe₂🦀₃⋅H₂🦀 Something like static_assert(std::is_standard_layout_v<T> && ...

Something like static_assert(std::is_standard_layout_v<T> && std::is_trivial_v<T>); or static_assert(std::is_pod_v<T>); (is_pod was deprecated in C++20) if you want the technical C++ definition of POD. static_assert(std::is_trivially_copyable_v<T>); is what you want if you just want to make sure memcpy‘ll work on the type.

Alternatively to static_assert, you can use SFINAE on a function to move the error to the call site.
Author Public Key
npub1w7x9m8xutlezyzmu7d78d8ygzk6sdpncfuuds8jsz2wnwk8f52dqkrpc4w