convert_integer.hpp 566 B

123456789101112131415161718192021222324
  1. // Copyright 2018-2019 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. #ifndef BOOST_HISTOGRAM_DETAIL_CONVERT_INTEGER_HPP
  7. #define BOOST_HISTOGRAM_DETAIL_CONVERT_INTEGER_HPP
  8. #include <type_traits>
  9. namespace boost {
  10. namespace histogram {
  11. namespace detail {
  12. template <class T, class U>
  13. using convert_integer =
  14. std::conditional_t<std::is_integral<std::decay_t<T>>::value, U, T>;
  15. }
  16. } // namespace histogram
  17. } // namespace boost
  18. #endif