make_unsigned.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Distributed under the Boost Software License, Version 1.0.
  3. * (See accompanying file LICENSE_1_0.txt or copy at
  4. * http://www.boost.org/LICENSE_1_0.txt)
  5. *
  6. * Copyright (c) 2017 Andrey Semashev
  7. */
  8. /*!
  9. * \file atomic/detail/type_traits/make_unsigned.hpp
  10. *
  11. * This header defines \c make_unsigned type trait
  12. */
  13. #ifndef BOOST_ATOMIC_DETAIL_TYPE_TRAITS_MAKE_UNSIGNED_HPP_INCLUDED_
  14. #define BOOST_ATOMIC_DETAIL_TYPE_TRAITS_MAKE_UNSIGNED_HPP_INCLUDED_
  15. #include <boost/atomic/detail/config.hpp>
  16. // Some versions of libstdc++ don't consider __int128 an integral type. Use Boost.TypeTraits because of that.
  17. #if !defined(BOOST_ATOMIC_DETAIL_NO_CXX11_BASIC_HDR_TYPE_TRAITS) && !defined(BOOST_HAS_INT128)
  18. #include <type_traits>
  19. #else
  20. #include <boost/type_traits/make_unsigned.hpp>
  21. #endif
  22. #ifdef BOOST_HAS_PRAGMA_ONCE
  23. #pragma once
  24. #endif
  25. namespace boost {
  26. namespace atomics {
  27. namespace detail {
  28. #if !defined(BOOST_ATOMIC_DETAIL_NO_CXX11_BASIC_HDR_TYPE_TRAITS) && !defined(BOOST_HAS_INT128)
  29. using std::make_unsigned;
  30. #else
  31. using boost::make_unsigned;
  32. #endif
  33. } // namespace detail
  34. } // namespace atomics
  35. } // namespace boost
  36. #endif // BOOST_ATOMIC_DETAIL_TYPE_TRAITS_MAKE_UNSIGNED_HPP_INCLUDED_