// @HEADER // ***************************************************************************** // Stokhos Package // // Copyright 2009 NTESS and the Stokhos contributors. // SPDX-License-Identifier: BSD-3-Clause // ***************************************************************************** // @HEADER #ifndef SACADO_MP_EXPRESSIONTRAITS_HPP #define SACADO_MP_EXPRESSIONTRAITS_HPP #include "Sacado_Traits.hpp" // Forward declarations namespace Sacado { namespace MP { template class Expr; } } namespace Sacado { //! Specialization of %ScalarType to Expr types template struct ScalarType< MP::Expr > { typedef typename ScalarType< typename MP::Expr::value_type >::type type; }; //! Specialization of %ValueType to Expr types template struct ValueType< MP::Expr > { typedef typename MP::Expr::value_type type; }; //! Specialization of %IsADType to Expr types template struct IsADType< MP::Expr > { static const bool value = true; }; //! Specialization of %IsADType to Expr types template struct IsScalarType< MP::Expr > { static const bool value = false; }; //! Specialization of %Value to Expr types template struct Value< MP::Expr > { typedef typename ValueType< MP::Expr >::type value_type; static const value_type& eval(const MP::Expr& x) { return x.val(); } }; //! Specialization of %ScalarValue to Expr types template struct ScalarValue< MP::Expr > { typedef typename ValueType< MP::Expr >::type value_type; typedef typename ScalarType< MP::Expr >::type scalar_type; static const scalar_type& eval(const MP::Expr& x) { return ScalarValue::eval(x.val()); } }; } // namespace Sacado #endif // SACADO_MP_EXPRESSIONTRAITS_HPP