Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
is_only_explicitly_constructible.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_ONLY_EXPLICITLY_CONSTRUCTIBLE_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TYPE_TRAITS_IS_ONLY_EXPLICITLY_CONSTRUCTIBLE_HPP_
7
8// IWYU pragma: begin_keep
9#include "arene/base/stdlib_choice/integral_constant.hpp"
10#include "arene/base/stdlib_choice/is_constructible.hpp"
11#include "arene/base/type_traits/is_implicitly_constructible.hpp"
12// IWYU pragma: end_keep
13
14// parasoft-begin-suppress AUTOSAR-A2_7_3-a "False positive: Everything is preceeded by a comment with @brief"
15
16namespace arene {
17namespace base {
18
19/// @brief Type trait to detect if a type is explicitly constructible from arguments of the specified types
20/// @tparam T The type to check if it can be explicitly constructed.
21/// @tparam Args The arguments to try to explicitly construct with.
22template <class T, class... Args>
23extern constexpr bool is_only_explicitly_constructible_v =
24 std::is_constructible<T, Args...>::value && !is_implicitly_constructible_v<T, Args...>;
25
26/// @brief Type trait to detect if a type is explicitly constructible from arguments of the specified types
27/// @tparam T The type to check if it can be explicitly constructed.
28/// @tparam Args The arguments to try to explicitly construct with.
29template <class T, class... Args>
32
33/// @brief Type trait to detect if a type is nothrow explicitly constructible from arguments of the specified types
34/// @tparam T The type to check if it can be nothrow explicitly constructed.
35/// @tparam Args The arguments to try to nothrow explicitly construct with.
36template <class T, class... Args>
38 std::is_nothrow_constructible<T, Args...>::value && !is_nothrow_implicitly_constructible_v<T, Args...>;
39
40/// @brief Type trait to detect if a type is nothrow explicitly constructible from arguments of the specified types
41/// @tparam T The type to check if it can be nothrow explicitly constructed.
42/// @tparam Args The arguments to try to nothrow explicitly construct with.
43template <class T, class... Args>
46
47} // namespace base
48} // namespace arene
49
50#endif // INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TYPE_TRAITS_IS_ONLY_EXPLICITLY_CONSTRUCTIBLE_HPP_
Type trait to detect if a type is nothrow explicitly constructible from arguments of the specified ty...
Definition is_only_explicitly_constructible.hpp:45
Type trait to detect if a type is explicitly constructible from arguments of the specified types.
Definition is_only_explicitly_constructible.hpp:31
Definition array_exceptions_disabled.cpp:11
constexpr bool is_nothrow_only_explicitly_constructible_v
Type trait to detect if a type is nothrow explicitly constructible from arguments of the specified ty...
constexpr bool is_only_explicitly_constructible_v
Type trait to detect if a type is explicitly constructible from arguments of the specified types.
Copyright 2026, Toyota Motor Corporation.
Definition array_exceptions_disabled.cpp:10