diff --git a/src/atlas/array/ArrayViewVariant.cc b/src/atlas/array/ArrayViewVariant.cc index f62efd2d8..cd0a2ad65 100644 --- a/src/atlas/array/ArrayViewVariant.cc +++ b/src/atlas/array/ArrayViewVariant.cc @@ -10,6 +10,8 @@ #include #include +#include "atlas/array/Array.h" +#include "atlas/array/MakeView.h" #include "atlas/runtime/Exception.h" namespace atlas { @@ -49,10 +51,9 @@ VariantType executeMakeView(ArrayType& array, if constexpr (TypeIndex < std::variant_size_v> - 1) { return executeMakeView(array, makeView); } else { - throw_Exception("ArrayView<" + array.datatype().str() + ", " + - std::to_string(array.rank()) + - "> is not an alternative in ArrayViewVariant.", - Here()); + ATLAS_THROW_EXCEPTION("Array with rank = " + std::to_string(array.rank()) + + " and datatype = " + array.datatype().str() + + " is not supported."); } } diff --git a/src/atlas/array/ArrayViewVariant.h b/src/atlas/array/ArrayViewVariant.h index 94dff8115..1193e9e59 100644 --- a/src/atlas/array/ArrayViewVariant.h +++ b/src/atlas/array/ArrayViewVariant.h @@ -7,17 +7,16 @@ #pragma once +#include #include -#include "atlas/array.h" +#include "atlas/array/ArrayView.h" namespace atlas { namespace array { namespace detail { -using namespace array; - // Container struct for a list of types. template struct Types { @@ -54,6 +53,8 @@ using VariantRanks = detail::Ints<1, 2, 3, 4, 5, 6, 7, 8, 9>; } // namespace detail +class Array; + /// @brief Variant containing all supported non-const ArrayView alternatives. using ArrayViewVariant = detail::Variant; diff --git a/src/atlas/runtime/Exception.h b/src/atlas/runtime/Exception.h index 5220c835a..194180b26 100644 --- a/src/atlas/runtime/Exception.h +++ b/src/atlas/runtime/Exception.h @@ -11,6 +11,7 @@ #pragma once #include +#include #include "eckit/log/CodeLocation.h"