Trivially copyable types are an important performance concept in C++. A trivially copyable object can be treated as a block of bits and copied using primitive memory operations (e.g. memcpy and memmove). Compiler Explorer link: https://lnkd.in/esRfj4kA #cpp #cplusplus #coding #programming #dailybiteofcpp
And yet, a coroutine with a (user) state of trivially copyable types is not copyable in C++20, how’s that for zero overhead principle…
Rafael Parisi, olha que curioso.
CREDO-DIALOGUE•580 followers
2yWill be useful to write few static asserts to check it using std::is_trivially_copyable