diff --git a/src/core/include/mp-units/compat_macros.h b/src/core/include/mp-units/compat_macros.h index 99fafa40..c26f94a4 100644 --- a/src/core/include/mp-units/compat_macros.h +++ b/src/core/include/mp-units/compat_macros.h @@ -26,7 +26,7 @@ #include -#ifdef MP_UNITS_API_NO_CRTP +#if MP_UNITS_API_NO_CRTP #define QUANTITY_SPEC(name, ...) \ inline constexpr struct name final : ::mp_units::quantity_spec<__VA_ARGS__> { \ diff --git a/src/core/include/mp-units/framework/quantity_spec.h b/src/core/include/mp-units/framework/quantity_spec.h index 855dd25c..bfaadbdd 100644 --- a/src/core/include/mp-units/framework/quantity_spec.h +++ b/src/core/include/mp-units/framework/quantity_spec.h @@ -112,11 +112,11 @@ using to_dimension = std::remove_const_t; template [[nodiscard]] consteval auto get_associated_quantity(U); -#ifndef MP_UNITS_API_NO_CRTP +#if !MP_UNITS_API_NO_CRTP template #endif struct quantity_spec_interface { -#ifdef MP_UNITS_API_NO_CRTP +#if MP_UNITS_API_NO_CRTP template U> [[nodiscard]] consteval Reference auto operator[](this Self self, U u) { @@ -171,7 +171,7 @@ MP_UNITS_EXPORT_BEGIN * types `speed` and `velocity` are considered not equal to `derived_dimension>` or * to each other. */ -#ifdef MP_UNITS_API_NO_CRTP +#if MP_UNITS_API_NO_CRTP template #else template @@ -216,7 +216,7 @@ MP_UNITS_EXPORT_END * @tparam BaseDimension base dimension for which a base quantity is being defined * @tparam Args optionally a value of a `quantity_character` in case the base quantity should not be scalar */ -#ifdef MP_UNITS_API_NO_CRTP +#if MP_UNITS_API_NO_CRTP template auto... Args> requires(... && !QuantitySpec) struct quantity_spec : detail::quantity_spec_interface { @@ -260,7 +260,7 @@ struct quantity_spec : detail::quantity_spec_interface * @tparam Eq quantity equation specification of a derived quantity * @tparam Args optionally a value of a `quantity_character` in case the base quantity should not be scalar */ -#ifdef MP_UNITS_API_NO_CRTP +#if MP_UNITS_API_NO_CRTP template auto... Args> requires(... && !QuantitySpec) struct quantity_spec : detail::quantity_spec_interface { @@ -314,7 +314,7 @@ struct propagate_equation { * @tparam Args optionally a value of a `quantity_character` in case the base quantity should not be scalar * or `is_kind` in case the quantity starts a new hierarchy tree of a kind */ -#ifdef MP_UNITS_API_NO_CRTP +#if MP_UNITS_API_NO_CRTP template auto... Args> requires(... && !QuantitySpec) struct quantity_spec : detail::propagate_equation, detail::quantity_spec_interface { @@ -328,7 +328,7 @@ struct quantity_spec : detail::propagate_equation, detail static constexpr Dimension auto dimension = _parent_.dimension; static constexpr quantity_character character = detail::quantity_character_init(QS.character); -#ifndef MP_UNITS_API_NO_CRTP +#if !MP_UNITS_API_NO_CRTP template U> [[nodiscard]] MP_UNITS_CONSTEVAL Reference auto operator[](U u) const { @@ -376,7 +376,7 @@ struct quantity_spec : detail::propagate_equation, detail * or `is_kind` in case the quantity starts a new hierarchy tree of a kind */ // clang-format on -#ifdef MP_UNITS_API_NO_CRTP +#if MP_UNITS_API_NO_CRTP template auto... Args> requires(!requires { QS._equation_; } || (requires { @@ -402,7 +402,7 @@ namespace detail { template struct derived_quantity_spec_impl : -#ifdef MP_UNITS_API_NO_CRTP +#if MP_UNITS_API_NO_CRTP detail::quantity_spec_interface, #else detail::quantity_spec_interface>, @@ -496,7 +496,7 @@ template } // namespace detail -#ifdef MP_UNITS_API_NO_CRTP +#if MP_UNITS_API_NO_CRTP template requires detail::QuantitySpecWithNoSpecifiers && (detail::get_kind_tree_root(Q{}) == Q{}) struct kind_of_ final : Q::_base_type_ { @@ -1479,7 +1479,7 @@ template requires requires(Q q) { get_kind_tree_root(q); } using to_kind = decltype(get_kind_tree_root(Q{})); -#ifdef MP_UNITS_API_NO_CRTP +#if MP_UNITS_API_NO_CRTP template [[nodiscard]] consteval bool defined_as_kind(quantity_spec) #else diff --git a/src/core/include/mp-units/framework/quantity_spec_concepts.h b/src/core/include/mp-units/framework/quantity_spec_concepts.h index dba816d0..7443c9d6 100644 --- a/src/core/include/mp-units/framework/quantity_spec_concepts.h +++ b/src/core/include/mp-units/framework/quantity_spec_concepts.h @@ -31,7 +31,7 @@ namespace mp_units { MP_UNITS_EXPORT -#ifdef MP_UNITS_API_NO_CRTP +#if MP_UNITS_API_NO_CRTP template #else template @@ -52,7 +52,7 @@ inline constexpr bool is_specialization_of_kind_of> = true; template concept QuantityKindSpec = is_specialization_of_kind_of; -#ifdef MP_UNITS_API_NO_CRTP +#if MP_UNITS_API_NO_CRTP template void to_base_specialization_of_quantity_spec(const volatile quantity_spec*); #else diff --git a/test/static/test_tools.h b/test/static/test_tools.h index 7c7421b6..2a1e29b8 100644 --- a/test/static/test_tools.h +++ b/test/static/test_tools.h @@ -30,7 +30,7 @@ template inline constexpr bool is_of_type = std::is_same_v; // NOLINTBEGIN(cppcoreguidelines-macro-usage) -#ifdef MP_UNITS_API_NO_CRTP +#if MP_UNITS_API_NO_CRTP #define QUANTITY_SPEC_(name, ...) \ inline constexpr struct name##_ final : quantity_spec<__VA_ARGS__> { \