Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
negation.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_NEGATION_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TYPE_TRAITS_NEGATION_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/stdlib_choice/integral_constant.hpp"
12
13namespace arene {
14namespace base {
15
16// parasoft-begin-suppress AUTOSAR-A2_7_3-a "False positive: all declarations are documented."
17/// @brief Negates the value of a boolean type trait
18/// @tparam BoolTrait the trait to negate
19template <typename BoolTrait>
20class negation : public std::integral_constant<bool, !bool(BoolTrait::value)> {};
21
22/// @brief The negated value of a boolean type trait
23/// @tparam BoolTrait the trait to negate
24/// @returns bool Equivalent to @c !BoolTrait::value .
25template <typename BoolTrait>
26extern constexpr bool negation_v{negation<BoolTrait>::value};
27
28// parasoft-end-suppress AUTOSAR-A2_7_3-a "False positive: all declarations are documented."
29
30} // namespace base
31} // namespace arene
32
33#endif // INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TYPE_TRAITS_NEGATION_HPP_
Negates the value of a boolean type trait.
Definition negation.hpp:20
Definition array_exceptions_disabled.cpp:11
constexpr bool negation_v
The negated value of a boolean type trait.
Copyright 2026, Toyota Motor Corporation.
Definition array_exceptions_disabled.cpp:10