4#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_UNITS_IS_POSSIBLE_UNIT_FOR_HPP_
5#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_UNITS_IS_POSSIBLE_UNIT_FOR_HPP_
7#include "arene/base/constraints/constraints.hpp"
8#include "arene/base/stdlib_choice/enable_if.hpp"
9#include "arene/base/stdlib_choice/is_same.hpp"
10#include "arene/base/units/has_parent_kind.hpp"
11#include "arene/base/units/is_quantity_kind.hpp"
12#include "arene/base/units/is_unit.hpp"
17namespace units_detail {
22template <
typename Unit,
typename Kind,
typename = constraints<>>
23extern constexpr bool is_declared_possible_unit_for_v =
false;
29template <
typename Unit,
typename Kind>
30extern constexpr bool is_declared_possible_unit_for_v<
33 constraints<std::enable_if_t<std::is_same<Kind,
typename Unit::unit_kind_type>::value>>> =
true;
36namespace is_possible_unit_for_detail {
42template <
typename Unit,
typename Kind,
typename = constraints<>>
43extern constexpr bool is_possible_unit_for_v =
false;
49template <
typename Unit,
typename Kind>
50extern constexpr bool is_possible_unit_for_v<
53 constraints<std::enable_if_t<units_detail::is_declared_possible_unit_for_v<Unit, Kind>>>> =
54 is_quantity_kind_v<Unit>;
60template <
typename Unit,
typename Kind>
61extern constexpr bool is_possible_unit_for_v<
65 std::enable_if_t<!units_detail::is_declared_possible_unit_for_v<Unit, Kind>>,
66 std::enable_if_t<!is_unit_v<
typename Unit::unit_kind_type>>,
67 std::enable_if_t<units_detail::has_parent_kind_v<Kind>>>> =
68 is_quantity_kind_v<Unit> && is_possible_unit_for_v<Unit,
typename Kind::parent_quantity_kind_type>;
74template <
typename Unit,
typename Kind>
75extern constexpr bool is_possible_unit_for_v<
79 std::enable_if_t<!units_detail::is_declared_possible_unit_for_v<Unit, Kind>>,
80 std::enable_if_t<is_unit_v<
typename Unit::unit_kind_type>>>> =
81 is_possible_unit_for_v<
typename Unit::unit_kind_type, Kind>;
89template <
typename Unit,
typename Kind>
Definition array_exceptions_disabled.cpp:11
constexpr bool is_possible_unit_for_v
Type trait for detecting if a type is a unit for a specific quantity kind. Evaluates to true if Unit ...
Copyright 2026, Toyota Motor Corporation.
Definition array_exceptions_disabled.cpp:10