diff --git a/include/boost/histogram/accumulators/mean.hpp b/include/boost/histogram/accumulators/mean.hpp index 0bf321ef..f6f15d2a 100644 --- a/include/boost/histogram/accumulators/mean.hpp +++ b/include/boost/histogram/accumulators/mean.hpp @@ -30,7 +30,7 @@ class mean { using value_type = ValueType; using const_reference = const value_type&; - struct impl_type { + struct data_type { value_type sum_; value_type mean_; value_type sum_of_deltas_squared_; @@ -152,7 +152,7 @@ class mean { } private: - impl_type data_{0, 0, 0}; + data_type data_{0, 0, 0}; friend struct ::boost::histogram::unsafe_access; }; diff --git a/include/boost/histogram/unsafe_access.hpp b/include/boost/histogram/unsafe_access.hpp index 430b643f..4783694d 100644 --- a/include/boost/histogram/unsafe_access.hpp +++ b/include/boost/histogram/unsafe_access.hpp @@ -97,8 +97,8 @@ struct unsafe_access { Get buffer of unlimited_storage. @param storage instance of unlimited_storage. */ - template - static constexpr auto& unlimited_storage_buffer(unlimited_storage& storage) { + template + static constexpr auto& unlimited_storage_buffer(T& storage) { return storage.buffer_; } @@ -107,16 +107,16 @@ struct unsafe_access { @param storage instance of storage_adaptor. */ template - static constexpr auto& storage_adaptor_impl(storage_adaptor& storage) { - return static_cast::impl_type&>(storage); + static constexpr auto& storage_adaptor_impl(T& storage) { + return static_cast(storage); } /** - Get internal data of accumulators::mean. + Get internal data of accumulator. @param obj instance of accumulator. */ template - static constexpr auto& accumulators_mean_impl(T& m) { + static constexpr auto& accumulator_data(T& m) { return m.data_; } }; diff --git a/test/accumulators_mean_test.cpp b/test/accumulators_mean_test.cpp index 9ed185ec..46cd4759 100644 --- a/test/accumulators_mean_test.cpp +++ b/test/accumulators_mean_test.cpp @@ -118,7 +118,7 @@ int main() { a(2); BOOST_TEST_EQ(a.count(), 2); - unsafe_access::accumulators_mean_impl(a).sum_ = 1; + unsafe_access::accumulator_data(a).sum_ = 1; BOOST_TEST_EQ(a.count(), 1); }