This commit is contained in:
Hans Dembinski 2018-11-14 00:15:32 +01:00
parent 49ebd1c3ce
commit 692f8082c8
3 changed files with 6 additions and 3 deletions

View File

@ -83,6 +83,8 @@ struct element_adaptor_generic {
template <typename T>
using element_adaptor =
mp11::mp_if<is_accumulator_set<T>, element_adaptor_accumulator_set,
// is_incrementable is used instead of std::is_arithmetic, which also
// works with wrapped integers like copyable_atomic<int>
mp11::mp_if<detail::is_incrementable<T>, element_adaptor_incrementable,
element_adaptor_generic>>;

View File

@ -291,7 +291,8 @@ void run_tests() {
// d1 mean
{
auto h = make_s(Tag(), std::vector<accumulators::mean<>>(), axis::integer<>(0, 2));
auto h =
make_s(Tag(), std::vector<accumulators::mean<double>>(), axis::integer<>(0, 2));
h(0, sample(1));
h(0, sample(2));
@ -310,7 +311,7 @@ void run_tests() {
// d1 weighted mean
{
auto h = make_s(Tag(), std::vector<accumulators::weighted_mean<>>(),
auto h = make_s(Tag(), std::vector<accumulators::weighted_mean<double>>(),
axis::integer<>(0, 2));
h(0, sample(1));

View File

@ -214,7 +214,7 @@ int main() {
// with accumulators::weighted_mean
{
auto a = storage_adaptor<std::vector<accumulators::weighted_mean<>>>();
auto a = storage_adaptor<std::vector<accumulators::weighted_mean<double>>>();
a.reset(1);
a(0, /* sample */ 1);
a(0, /* weight */ 2, /* sample */ 2);