diff --git a/include/boost/histogram/accumulators/collector.hpp b/include/boost/histogram/accumulators/collector.hpp index 06f0d30e..e01fa3c2 100644 --- a/include/boost/histogram/accumulators/collector.hpp +++ b/include/boost/histogram/accumulators/collector.hpp @@ -2,6 +2,7 @@ #define BOOST_HISTOGRAM_ACCUMULATORS_COLLECTOR_HPP #include // for std::equal +#include #include #include // for collector<> #include diff --git a/test/accumulators_serialization_test.cpp b/test/accumulators_serialization_test.cpp index b09132a8..bc9d015e 100644 --- a/test/accumulators_serialization_test.cpp +++ b/test/accumulators_serialization_test.cpp @@ -102,5 +102,19 @@ int main(int argc, char** argv) { BOOST_TEST(a == b); } + // collector + { + const auto filename = join(argv[1], "accumulators_serialization_test_collector.xml"); + accumulators::collector<> a; + a(1.5); + a(4.0); + print_xml(filename, a); + + accumulators::collector<> b; + BOOST_TEST_NOT(a == b); + load_xml(filename, b); + BOOST_TEST(a == b); + } + return boost::report_errors(); }