VCCC  2024.05
VisualCamp Common C++ library
movable.hpp
Go to the documentation of this file.
1 //
2 // Created by cosge on 2023-12-02.
3 //
4 
5 #ifndef VCCC_CONCEPTS_MOVABLE_HPP_
6 #define VCCC_CONCEPTS_MOVABLE_HPP_
7 
8 #include <type_traits>
9 
16 
17 namespace vccc {
18 namespace detail {
19 
21 struct movable_impl
22  : conjunction<
23  std::is_object<T>,
24  move_constructible<T>,
25  assignable_from<T&, T>,
26  swappable<T>
27  > {};
28 
29 template<typename T>
30 struct movable_impl<T, false> : std::false_type {};
31 
32 } // namespace detail
33 
36 
57 template<typename T>
58 struct movable : detail::movable_impl<T> {};
59 
61 
62 } // namespace vccc
63 
64 #endif // VCCC_CONCEPTS_MOVABLE_HPP_
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
specifies that an object of a type can be moved and swapped
Definition: movable.hpp:58