1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #ifndef BOOST_HISTOGRAM_ACCUMULATORS_IS_THREAD_SAFE_HPP
- #define BOOST_HISTOGRAM_ACCUMULATORS_IS_THREAD_SAFE_HPP
- #include <boost/histogram/detail/priority.hpp>
- #include <boost/histogram/fwd.hpp>
- #include <type_traits>
- namespace boost {
- namespace histogram {
- namespace detail {
- template <class T>
- constexpr bool is_thread_safe_impl(priority<0>) {
- return false;
- }
- template <class T>
- constexpr auto is_thread_safe_impl(priority<1>) -> decltype(T::thread_safe()) {
- return T::thread_safe();
- }
- }
- namespace accumulators {
- template <class T>
- struct is_thread_safe
- : std::integral_constant<bool,
- detail::is_thread_safe_impl<T>(detail::priority<1>{})> {};
- }
- }
- }
- #endif
|