xref: /freebsd/contrib/llvm-project/libc/src/__support/CPP/type_traits/is_move_constructible.h (revision bb722a7d0f1642bff6487f943ad0427799a6e5bf)
1 //===-- is_move_constructible type_traits ------------------------*- C++-*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 #ifndef LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_IS_MOVE_CONSTRUCTIBLE_H
9 #define LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_IS_MOVE_CONSTRUCTIBLE_H
10 
11 #include "src/__support/CPP/type_traits/add_rvalue_reference.h"
12 #include "src/__support/CPP/type_traits/integral_constant.h"
13 #include "src/__support/macros/config.h"
14 
15 namespace LIBC_NAMESPACE_DECL {
16 namespace cpp {
17 
18 // is move constructible
19 template <class T>
20 struct is_move_constructible
21     : public integral_constant<bool, __is_constructible(
22                                          T, cpp::add_rvalue_reference_t<T>)> {};
23 
24 template <class T>
25 LIBC_INLINE_VAR constexpr bool is_move_constructible_v =
26     is_move_constructible<T>::value;
27 
28 } // namespace cpp
29 } // namespace LIBC_NAMESPACE_DECL
30 
31 #endif // LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_IS_MOVE_CONSTRUCTIBLE_H
32