move.hpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //-----------------------------------------------------------------------------
  2. // boost variant/detail/move.hpp header file
  3. // See http://www.boost.org for updates, documentation, and revision history.
  4. //-----------------------------------------------------------------------------
  5. //
  6. // Copyright (c) 2002-2003 Eric Friedman
  7. // Copyright (c) 2002 by Andrei Alexandrescu
  8. // Copyright (c) 2013-2024 Antony Polukhin
  9. //
  10. // Use, modification and distribution are subject to the
  11. // Boost Software License, Version 1.0. (See accompanying file
  12. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  13. //
  14. // This file derivative of MoJO. Much thanks to Andrei for his initial work.
  15. // See <http://www.cuj.com/experts/2102/alexandr.htm> for information on MOJO.
  16. // Re-issued here under the Boost Software License, with permission of the original
  17. // author (Andrei Alexandrescu).
  18. #ifndef BOOST_VARIANT_DETAIL_MOVE_HPP
  19. #define BOOST_VARIANT_DETAIL_MOVE_HPP
  20. #include <boost/config.hpp>
  21. #include <boost/detail/workaround.hpp>
  22. #include <utility>
  23. namespace boost { namespace detail { namespace variant {
  24. using std::move;
  25. //////////////////////////////////////////////////////////////////////////
  26. // function template move_swap
  27. //
  28. // Swaps using Koenig lookup but falls back to move-swap for primitive
  29. // types and on non-conforming compilers.
  30. //
  31. template <typename T>
  32. inline void move_swap(T& lhs, T& rhs)
  33. {
  34. using std::swap;
  35. swap(lhs, rhs);
  36. }
  37. }}} // namespace boost::detail::variant
  38. #endif // BOOST_VARIANT_DETAIL_MOVE_HPP