Now, every operation concerning Tensors are guarded with the EnableIfScalar
type trait. Consequently, a VectorizedArray has also to be made a scalar
type.
// forward declarations
DEAL_II_NAMESPACE_OPEN
-
template <typename Number> class VectorizedArray;
-
+template <typename T> struct EnableIfScalar;
DEAL_II_NAMESPACE_CLOSE
+
namespace std
{
template <typename Number> ::dealii::VectorizedArray<Number>
}
-
DEAL_II_NAMESPACE_OPEN
+
+// Enable the EnableIfScalar type trait for VectorizedArray<Number> such
+// that it can be used as a Number type in Tensor<rank,dim,Number>, etc.
+
+template<typename Number>
+struct EnableIfScalar<VectorizedArray<Number> >
+{
+ typedef VectorizedArray<typename EnableIfScalar<Number>::type> type;
+};
+
+
/**
* This generic class defines a unified interface to a vectorized data type.
* For general template arguments, this class simply corresponds to the
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams