diff --git a/include/symtensor/SymmetricTensorBase.h b/include/symtensor/SymmetricTensorBase.h index 8b127f2..60f9e51 100644 --- a/include/symtensor/SymmetricTensorBase.h +++ b/include/symtensor/SymmetricTensorBase.h @@ -219,12 +219,12 @@ namespace symtensor { ALWAYS_INLINE static constexpr Implementation NullaryExpression(F function = {}) { if constexpr (requires { function.template operator()(); }) { // If a function provides a template parameter for compile-time indexing, prefer that - return [&](std::index_sequence) LAMBDA_ALWAYS_INLINE constexpr { + return [&](std::index_sequence) LAMBDA_ALWAYS_INLINE { return Implementation{static_cast(function.template operator()())...}; }(std::make_index_sequence()); } else { // Otherwise, the function must take the indices as its only argument - return [&](std::index_sequence) LAMBDA_ALWAYS_INLINE constexpr { + return [&](std::index_sequence) LAMBDA_ALWAYS_INLINE { return Implementation{static_cast(function(dimensionalIndices(i)))...}; }(std::make_index_sequence()); } diff --git a/include/symtensor/gravity.h b/include/symtensor/gravity.h index ec95ba8..436ee5a 100644 --- a/include/symtensor/gravity.h +++ b/include/symtensor/gravity.h @@ -112,10 +112,9 @@ namespace symtensor::gravity { template ALWAYS_INLINE auto derivative(const Vector &R) { - return SymmetricTensor3f::NullaryExpression([&]() LAMBDA_ALWAYS_INLINE constexpr { + return SymmetricTensor3f::NullaryExpression([&]() LAMBDA_ALWAYS_INLINE { return derivative_at(R); }); - };