1 // Copyright 2015-2018 Hans Dembinski 2 // 3 // Distributed under the Boost Software License, Version 1.0. 4 // (See accompanying file LICENSE_1_0.txt 5 // or copy at http://www.boost.org/LICENSE_1_0.txt) 6 7 #include <boost/core/lightweight_test.hpp> 8 #include <boost/histogram/accumulators/ostream.hpp> 9 #include <boost/histogram/accumulators/thread_safe.hpp> 10 #include <sstream> 11 #include "throw_exception.hpp" 12 #include "utility_str.hpp" 13 14 using namespace boost::histogram; 15 using namespace std::literals; 16 main()17int main() { 18 using ts_t = accumulators::thread_safe<int>; 19 20 ts_t i; 21 ++i; 22 i += 1000; 23 24 BOOST_TEST_EQ(i, 1001); 25 BOOST_TEST_EQ(str(i), "1001"s); 26 27 BOOST_TEST_EQ(ts_t{} += ts_t{}, ts_t{}); 28 29 return boost::report_errors(); 30 } 31