std::atomic<T> may not have value_type

This commit is contained in:
mutouyun 2019-01-04 22:26:40 +08:00
parent 98c367a380
commit 90c60ddd58

View File

@ -122,7 +122,11 @@ struct prod_cons<relat::single, relat::multi, trans::broadcast> {
template <std::size_t DataSize> template <std::size_t DataSize>
constexpr static std::size_t elem_param = DataSize; constexpr static std::size_t elem_param = DataSize;
using rc_t = typename decltype(detail::elem_head::rc_)::value_type; /*
<Remarks> std::atomic<T> may not have value_type.
See: https://stackoverflow.com/questions/53648614/what-happened-to-stdatomicxvalue-type
*/
using rc_t = decltype(detail::elem_head::rc_.load());
detail::u2_t cursor() const noexcept { detail::u2_t cursor() const noexcept {
return wt_.load(std::memory_order_acquire); return wt_.load(std::memory_order_acquire);