From 457cf8378be3dd8b72e5baf9d866221528363eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20Gr=C3=A4ser?= <graeser@dune-project.org> Date: Fri, 18 Sep 2015 14:02:38 +0200 Subject: [PATCH] Make default constructors of DenseVector and FieldVector constexpr Otherwise FieldVector is not a literal type and calling its size() method is not a const-expression although size() itself is declared as constexpr. --- dune/common/densevector.hh | 2 +- dune/common/fvector.hh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dune/common/densevector.hh b/dune/common/densevector.hh index 6dacfe661..94ec30c6b 100644 --- a/dune/common/densevector.hh +++ b/dune/common/densevector.hh @@ -244,7 +244,7 @@ namespace Dune { protected: // construction allowed to derived classes only - DenseVector () {} + DUNE_CONSTEXPR DenseVector () {} public: //===== type definitions and constants diff --git a/dune/common/fvector.hh b/dune/common/fvector.hh index 2718f8159..2c699549d 100644 --- a/dune/common/fvector.hh +++ b/dune/common/fvector.hh @@ -105,7 +105,7 @@ namespace Dune { typedef typename Base::value_type value_type; //! Constructor making default-initialized vector - FieldVector() + DUNE_CONSTEXPR FieldVector() : _data{} {} -- GitLab