File indexing completed on 2025-01-30 09:43:43
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_HISTOGRAM_ACCUMULATORS_IS_THREAD_SAFE_HPP
0008 #define BOOST_HISTOGRAM_ACCUMULATORS_IS_THREAD_SAFE_HPP
0009
0010 #include <boost/histogram/detail/priority.hpp>
0011 #include <boost/histogram/fwd.hpp>
0012 #include <type_traits>
0013
0014 namespace boost {
0015 namespace histogram {
0016 namespace detail {
0017
0018 template <class T>
0019 constexpr bool is_thread_safe_impl(priority<0>) {
0020 return false;
0021 }
0022
0023 template <class T>
0024 constexpr auto is_thread_safe_impl(priority<1>) -> decltype(T::thread_safe()) {
0025 return T::thread_safe();
0026 }
0027
0028 }
0029
0030 namespace accumulators {
0031
0032 template <class T>
0033 struct is_thread_safe
0034 : std::integral_constant<bool,
0035 detail::is_thread_safe_impl<T>(detail::priority<1>{})> {};
0036
0037 }
0038 }
0039 }
0040
0041 #endif