Skip to content

Commit b877d5f

Browse files
committed
Adding base class definitions for expression traits constants.
This fixes a compile error in MSVC 19.32. The compiler did not use/recognize the template argument Expr of 'NumberOfConstantTypeArguments' when instantiating 'NumberOfConstantTypeArguments::template eval<Expr>()'.
1 parent 8cdb2a2 commit b877d5f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

include/codi/traits/expressionTraits.hpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ namespace codi {
184184
struct NumberOfActiveTypeArguments : public CompileTimeTraversalLogic<size_t, NumberOfActiveTypeArguments<Expr>> {
185185
public:
186186

187+
/// Abbreviation for the base class type.
188+
using Base = CompileTimeTraversalLogic<size_t, NumberOfActiveTypeArguments<Expr>>;
189+
187190
/// \copydoc CompileTimeTraversalLogic::leaf()
188191
template<typename Node, typename = ExpressionTraits::EnableIfLhsExpression<Node>>
189192
CODI_INLINE static size_t constexpr leaf() {
@@ -192,7 +195,7 @@ namespace codi {
192195
using CompileTimeTraversalLogic<size_t, NumberOfActiveTypeArguments>::leaf;
193196

194197
/// See NumberOfActiveTypeArguments
195-
static size_t constexpr value = NumberOfActiveTypeArguments::template eval<Expr>();
198+
static size_t constexpr value = Base::template eval<Expr>();
196199
};
197200

198201
#if CODI_IS_CPP14
@@ -207,6 +210,9 @@ namespace codi {
207210
: public CompileTimeTraversalLogic<size_t, NumberOfConstantTypeArguments<Expr>> {
208211
public:
209212

213+
/// Abbreviation for the base class type.
214+
using Base = CompileTimeTraversalLogic<size_t, NumberOfConstantTypeArguments<Expr>>;
215+
210216
/// \copydoc CompileTimeTraversalLogic::leaf()
211217
template<typename Node, typename = EnableIfConstantExpression<Node>>
212218
CODI_INLINE static size_t constexpr leaf() {
@@ -215,7 +221,7 @@ namespace codi {
215221
using CompileTimeTraversalLogic<size_t, NumberOfConstantTypeArguments>::leaf;
216222

217223
/// See NumberOfConstantTypeArguments
218-
static size_t constexpr value = NumberOfConstantTypeArguments::template eval<Expr>();
224+
static size_t constexpr value = Base::template eval<Expr>();
219225
};
220226

221227
#if CODI_IS_CPP14

0 commit comments

Comments
 (0)