is_moveable.hpp 914 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* Copyright 2024 Joaquin M Lopez Munoz.
  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. * See http://www.boost.org/libs/poly_collection for library home page.
  7. */
  8. #ifndef BOOST_POLY_COLLECTION_DETAIL_IS_MOVEABLE_HPP
  9. #define BOOST_POLY_COLLECTION_DETAIL_IS_MOVEABLE_HPP
  10. #if defined(_MSC_VER)
  11. #pragma once
  12. #endif
  13. #include <type_traits>
  14. namespace boost{
  15. namespace poly_collection{
  16. namespace detail{
  17. template<typename T> struct is_moveable:std::integral_constant<
  18. bool,
  19. std::is_move_constructible<typename std::decay<T>::type>::value&&
  20. (std::is_move_assignable<typename std::decay<T>::type>::value||
  21. std::is_nothrow_move_constructible<typename std::decay<T>::type>::value)
  22. >{};
  23. } /* namespace poly_collection::detail */
  24. } /* namespace poly_collection */
  25. } /* namespace boost */
  26. #endif