Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
is_unit.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#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_UNITS_IS_UNIT_HPP_
5#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_UNITS_IS_UNIT_HPP_
6
7#include "arene/base/constraints/constraints.hpp"
8#include "arene/base/units/is_quantity_kind.hpp"
9
10namespace arene {
11namespace base {
12
13namespace is_unit_detail {
14
15/// @brief Type trait for detecting if a type is a unit. Evaluates to @c true if the type is a unit, @c false otherwise
16/// @tparam Kind the type to check
17template <typename Kind, typename = constraints<>>
18extern constexpr bool is_unit_v = false;
19
20/// @brief Type trait for detecting if a type is a unit. Evaluates to @c true if the type is a unit, @c false otherwise
21/// @tparam Kind the type to check
22template <typename Kind>
23extern constexpr bool is_unit_v<Kind, constraints<typename Kind::unit_kind_type>> = is_quantity_kind_v<Kind>;
24
25} // namespace is_unit_detail
26
27/// @brief Type trait for detecting if a type is a unit. Evaluates to @c true if the type is a unit, @c false otherwise
28/// @tparam Kind the type to check
29template <typename Kind>
30extern constexpr bool is_unit_v = is_unit_detail::is_unit_v<Kind>;
31
32} // namespace base
33} // namespace arene
34
35#endif // INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_UNITS_IS_UNIT_HPP_
Definition array_exceptions_disabled.cpp:11
constexpr bool is_unit_v
Type trait for detecting if a type is a unit. Evaluates to true if the type is a unit,...
Copyright 2026, Toyota Motor Corporation.
Definition array_exceptions_disabled.cpp:10