]>
Commit | Line | Data |
---|---|---|
f67539c2 TL |
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 | ||
1e59de90 TL |
17 | #include <boost/histogram/detail/ignore_deprecation_warning_begin.hpp> |
18 | ||
f67539c2 TL |
19 | int main() { |
20 | using ts_t = accumulators::thread_safe<int>; | |
21 | ||
22 | ts_t i; | |
23 | ++i; | |
24 | i += 1000; | |
25 | ||
26 | BOOST_TEST_EQ(i, 1001); | |
27 | BOOST_TEST_EQ(str(i), "1001"s); | |
28 | ||
1e59de90 TL |
29 | ts_t j{5}; |
30 | i = j; | |
31 | BOOST_TEST_EQ(i, 5); | |
32 | ||
f67539c2 TL |
33 | BOOST_TEST_EQ(ts_t{} += ts_t{}, ts_t{}); |
34 | ||
35 | return boost::report_errors(); | |
36 | } | |
1e59de90 TL |
37 | |
38 | #include <boost/histogram/detail/ignore_deprecation_warning_end.hpp> |