Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
is_movable.hpp
Go to the documentation of this file.
1
// Copyright 2026, Toyota Motor Corporation
2
//
3
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
5
#
ifndef
INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TYPE_TRAITS_IS_MOVABLE_HPP_
6
#
define
INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TYPE_TRAITS_IS_MOVABLE_HPP_
7
8
// IWYU pragma: private, include "arene/base/type_traits.hpp"
9
// IWYU pragma: friend "(arene/base(?!/tests)|stdlib/include/stdlib_detail)/.*"
10
11
#
include
"arene/base/constraints/constraints.hpp"
12
#
include
"arene/base/stdlib_choice/enable_if.hpp"
13
#
include
"arene/base/stdlib_choice/is_assignable.hpp"
14
#
include
"arene/base/stdlib_choice/is_move_constructible.hpp"
15
#
include
"arene/base/stdlib_choice/is_object.hpp"
16
#
include
"arene/base/type_traits/is_swappable.hpp"
17
18
namespace
arene
{
19
namespace
base
{
20
21
/// @brief Backport for the C++20 movable concept
22
///
23
/// @tparam T The type to test
24
///
25
/// The concept movable<T> specifies that T is an object type that can be moved (that is, it can be move constructed,
26
/// move assigned, and lvalues of type T can be swapped).
27
///
28
/// @{
29
template
<
class
T
,
class
=
arene
::
base
::
constraints
<>>
30
extern
constexpr
bool
is_movable_v
=
false
;
31
32
// Note: This is implemented with a constraint on std::is_object as some non-objects are not referenceable (e.g. void).
33
template
<
class
T
>
34
extern
constexpr
bool
is_movable_v
<
T
,
arene
::
base
::
constraints
<
std
::
enable_if_t
<
std
::
is_object
<
T
>::
value
>>> =
35
std
::
is_move_constructible
<
T
>::
value
&&
std
::
is_assignable
<
T
&,
T
>::
value
&&
is_swappable_v
<
T
>;
36
/// @}
37
38
}
// namespace base
39
}
// namespace arene
40
#
endif
// INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TYPE_TRAITS_IS_MOVABLE_HPP_
arene::base
Definition
array_exceptions_disabled.cpp:11
arene::base::is_movable_v
constexpr bool is_movable_v
Backport for the C++20 movable concept.
arene
Copyright 2026, Toyota Motor Corporation.
Definition
array_exceptions_disabled.cpp:10
arene
base
type_traits
is_movable.hpp
Generated by
1.13.2