xref: /freebsd/contrib/llvm-project/libcxx/include/__concepts/movable.h (revision 349cc55c9796c4596a5b9904cd3281af295f878f)
1*349cc55cSDimitry Andric //===----------------------------------------------------------------------===//
2*349cc55cSDimitry Andric //
3*349cc55cSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*349cc55cSDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5*349cc55cSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*349cc55cSDimitry Andric //
7*349cc55cSDimitry Andric //===----------------------------------------------------------------------===//
8*349cc55cSDimitry Andric 
9*349cc55cSDimitry Andric #ifndef _LIBCPP___CONCEPTS_MOVABLE_H
10*349cc55cSDimitry Andric #define _LIBCPP___CONCEPTS_MOVABLE_H
11*349cc55cSDimitry Andric 
12*349cc55cSDimitry Andric #include <__concepts/assignable.h>
13*349cc55cSDimitry Andric #include <__concepts/constructible.h>
14*349cc55cSDimitry Andric #include <__concepts/swappable.h>
15*349cc55cSDimitry Andric #include <__config>
16*349cc55cSDimitry Andric #include <type_traits>
17*349cc55cSDimitry Andric 
18*349cc55cSDimitry Andric #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
19*349cc55cSDimitry Andric #pragma GCC system_header
20*349cc55cSDimitry Andric #endif
21*349cc55cSDimitry Andric 
22*349cc55cSDimitry Andric _LIBCPP_BEGIN_NAMESPACE_STD
23*349cc55cSDimitry Andric 
24*349cc55cSDimitry Andric #if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
25*349cc55cSDimitry Andric 
26*349cc55cSDimitry Andric // [concepts.object]
27*349cc55cSDimitry Andric 
28*349cc55cSDimitry Andric template<class _Tp>
29*349cc55cSDimitry Andric concept movable =
30*349cc55cSDimitry Andric   is_object_v<_Tp> &&
31*349cc55cSDimitry Andric   move_constructible<_Tp> &&
32*349cc55cSDimitry Andric   assignable_from<_Tp&, _Tp> &&
33*349cc55cSDimitry Andric   swappable<_Tp>;
34*349cc55cSDimitry Andric 
35*349cc55cSDimitry Andric #endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
36*349cc55cSDimitry Andric 
37*349cc55cSDimitry Andric _LIBCPP_END_NAMESPACE_STD
38*349cc55cSDimitry Andric 
39*349cc55cSDimitry Andric #endif // _LIBCPP___CONCEPTS_MOVABLE_H
40