You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.3KB

  1. /// \file
  2. // Range v3 library
  3. //
  4. // Copyright Eric Niebler 2013-present
  5. //
  6. // Use, modification and distribution is subject to the
  7. // Boost Software License, Version 1.0. (See accompanying
  8. // file LICENSE_1_0.txt or copy at
  9. // http://www.boost.org/LICENSE_1_0.txt)
  10. //
  11. // Project home: https://github.com/ericniebler/range-v3
  12. //
  13. // The implementation of swap (see below) has been adapted from libc++
  14. // (http://libcxx.llvm.org).
  15. #ifndef RANGES_V3_UTILITY_SWAP_HPP
  16. #define RANGES_V3_UTILITY_SWAP_HPP
  17. #include <concepts/swap.hpp>
  18. #include <range/v3/range_fwd.hpp>
  19. #include <range/v3/utility/static_const.hpp>
  20. namespace ranges
  21. {
  22. template<typename T>
  23. using is_swappable = concepts::is_swappable<T>;
  24. template<typename T>
  25. using is_nothrow_swappable = concepts::is_nothrow_swappable<T>;
  26. template<typename T, typename U>
  27. using is_swappable_with = concepts::is_swappable_with<T, U>;
  28. template<typename T, typename U>
  29. using is_nothrow_swappable_with = concepts::is_nothrow_swappable_with<T, U>;
  30. using concepts::exchange;
  31. /// \ingroup group-utility
  32. /// \relates concepts::adl_swap_detail::swap_fn
  33. RANGES_DEFINE_CPO(uncvref_t<decltype(concepts::swap)>, swap)
  34. namespace cpp20
  35. {
  36. using ranges::swap;
  37. }
  38. } // namespace ranges
  39. #endif