From c554e576ebdf4286babaa3215f012249a007e44f Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Sat, 25 Jul 2015 12:26:41 +0200 Subject: [PATCH] Add constructor from std::initializer_list With this, you can now write Dune::Solvers::Interval<double> foo = {-1,1}; The patch also adds the default constructor, which is not automatically created anymore. --- dune/solvers/common/interval.hh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dune/solvers/common/interval.hh b/dune/solvers/common/interval.hh index e3c3c93..6530dac 100644 --- a/dune/solvers/common/interval.hh +++ b/dune/solvers/common/interval.hh @@ -18,6 +18,15 @@ template <class field_type> class Interval { public: + /** \brief Default constructor */ + Interval() + {} + + /** \brief Construct from an initializer list */ + Interval(std::initializer_list<field_type> const &input) + : data_(input) + {} + /** \brief Array-like access */ field_type& operator[](int i) -- GitLab