Hey timur,
I stumbled across your implementation of a seqlock and looked into the bytewise atomic memcpy because I need something similar:
|
dest_bytes[i] = std::atomic_ref<char>(src_bytes[i]).load(std::memory_order_relaxed); |
This does not seem to compile (https://godbolt.org/z/Pa5qjKb3T).
The atomic_ref<char> requires a (non-const) reference.
However, an atomic_ref<const char> seems to be fine in that particular place.
Hey timur,
I stumbled across your implementation of a seqlock and looked into the bytewise atomic memcpy because I need something similar:
crill/include/crill/bytewise_atomic_memcpy.h
Line 45 in 96d67ed
This does not seem to compile (https://godbolt.org/z/Pa5qjKb3T).
The
atomic_ref<char>requires a (non-const) reference.However, an
atomic_ref<const char>seems to be fine in that particular place.