Simplify dolfin::Parameter(s) by using boost::variant

Issue #907 resolved
Prof Garth Wells created an issue

The dolfin::Parameter(s) code is very complex owing to supporting multiple types. This could be made dramatically simpler and more robust by using boost::variant (http://www.boost.org/doc/libs/1_64_0/doc/html/variant.html), which will become std::variant in C++17 (http://en.cppreference.com/w/cpp/utility/variant).

As a minimal first step, a dolfin::Parameter could hold a

boost::variant<bool, int, double, std::string> _parameter;

dolfin::Parameters could become more-or-less a:

std::map<std::string, boost::variant<dolfin::Parameter, dolfin::Parameters>>

Comments (2)

  1. Log in to comment