Skip to content
Snippets Groups Projects
Commit c554e576 authored by Oliver Sander's avatar Oliver Sander
Browse files

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.
parent e4a84c25
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment