From 90c60ddd58d831c821a580fc7de59d1ee004f740 Mon Sep 17 00:00:00 2001 From: mutouyun Date: Fri, 4 Jan 2019 22:26:40 +0800 Subject: [PATCH] std::atomic may not have value_type --- include/circ_elems_array.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/circ_elems_array.h b/include/circ_elems_array.h index d989dbf..be45ee5 100644 --- a/include/circ_elems_array.h +++ b/include/circ_elems_array.h @@ -122,7 +122,11 @@ struct prod_cons { template constexpr static std::size_t elem_param = DataSize; - using rc_t = typename decltype(detail::elem_head::rc_)::value_type; + /* + std::atomic 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 { return wt_.load(std::memory_order_acquire);