diff --git a/common/include/fwd-valptridx.h b/common/include/fwd-valptridx.h index a64ad9ede..83263de1b 100644 --- a/common/include/fwd-valptridx.h +++ b/common/include/fwd-valptridx.h @@ -60,11 +60,21 @@ class valptridx : template class guarded; class array_base_count_type; - using array_base_storage_type = typename std::conditional< - std::is_enum::value, - dcx::enumerated_array, - std::array - >::type; + struct array_base_storage_integral + { + using type = std::array; + }; + /* Note: integral_type must be an `enum` type, but + * `requires(std::is_enum::value)` cannot be checked + * here, because the name `array_base_storage_enum` may be + * formed for non-enum types, but the internal type `type` will not be + * used in those cases. + */ + template + struct array_base_storage_enum + { + using type = dcx::enumerated_array; + }; protected: using const_pointer_type = const managed_type *; using const_reference_type = const managed_type &; @@ -75,6 +85,7 @@ protected: */ using typename specialized_types::integral_type; using index_type = integral_type; // deprecated; should be dedicated UDT + using array_base_storage_type = typename std::conditional::value, array_base_storage_integral, array_base_storage_enum>::type::type; public: class array_managed_type; diff --git a/common/main/d_array.h b/common/main/d_array.h index 476f300c9..1c5f4b1a5 100644 --- a/common/main/d_array.h +++ b/common/main/d_array.h @@ -24,6 +24,7 @@ namespace dcx { * Other types for E are not likely to be useful, but are not blocked. */ template +requires(!std::is_same::value && !std::is_same::value) struct enumerated_array : std::array { using base_type = std::array; diff --git a/common/main/fwd-d_array.h b/common/main/fwd-d_array.h index 9b09f485b..056d2911f 100644 --- a/common/main/fwd-d_array.h +++ b/common/main/fwd-d_array.h @@ -7,10 +7,12 @@ #pragma once #include +#include namespace dcx { template +requires(!std::is_same::value && !std::is_same::value) struct enumerated_array; }