diff --git a/src/common/dimensional_array.h b/src/common/dimensional_array.h index b4b6a4a43..ea3de5ee4 100644 --- a/src/common/dimensional_array.h +++ b/src/common/dimensional_array.h @@ -29,6 +29,9 @@ namespace detail { template struct DimensionalArrayExplicitRank; +// Workaround for VC2017 +#if defined(_MSC_VER) && _MSC_VER < 1920 + template struct GetRankSize { @@ -41,6 +44,22 @@ using GetArrayImplType = std::array>, GetRankSize::value>; +#else + +template +constexpr std::size_t GetRankSize() +{ + constexpr std::size_t size_array[] = {sizes...}; + return size_array[rank - 1]; +} + +template +using GetArrayImplType = + std::array>, + GetRankSize()>; + +#endif + template struct DimensionalArrayExplicitRank : public GetArrayImplType {