Skip to content
Snippets Groups Projects
Commit 3fd176b8 authored by Simon Praetorius's avatar Simon Praetorius
Browse files

Merge branch 'feature/empty-parameter-tree-unknown-diagnostic' into 'master'

Add special internal constructor for empty static parameter tree

See merge request !1349
parents b4c8be7f d0bdb705
No related branches found
No related tags found
1 merge request!1349Add special internal constructor for empty static parameter tree
Pipeline #73183 waiting for manual action
......@@ -20,7 +20,14 @@ using namespace Dune;
ParameterTree::ParameterTree()
{}
const Dune::ParameterTree Dune::ParameterTree::empty_;
// Since this (internal) tree is static and constant, its prefix cannot be changed even
// though we report it as the sub-tree of another one (in `.sub(prefix) const`).
// Thus, we set the prefix as "<unknown>" to inform users that we could not construct the real prefix.
ParameterTree::ParameterTree(ParameterTree::EmptyTag)
: prefix_{"<unknown>"}
{}
const ParameterTree ParameterTree::empty_ = ParameterTree{ParameterTree::EmptyTag()};
void ParameterTree::report(std::ostream& stream, const std::string& prefix) const
{
......
......@@ -40,6 +40,9 @@ namespace Dune {
template<typename T>
struct Parser;
struct EmptyTag {};
ParameterTree(EmptyTag);
public:
/** \brief storage for key lists
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment