diff --git a/BaseLib/ConfigTree.h b/BaseLib/ConfigTree.h index e4041229fe1cd959576b95fc914d75ec676c75e1..e2f637ba46f6b045430a74e3d99c9ee414f7d766 100644 --- a/BaseLib/ConfigTree.h +++ b/BaseLib/ConfigTree.h @@ -256,9 +256,16 @@ public: * i.e., warnings will also result in program abortion! */ explicit ConfigTree(PTree const& tree, - std::string const& filename, - Callback const& error_cb, - Callback const& warning_cb); + std::string const& filename, + Callback const& error_cb, + Callback const& warning_cb); + + /*! This constructor is deleted in order to prevent the user from passing + * temporary instances of \c PTree. + * Doing so would lead to a dangling reference \c _tree and to program crash. + */ + explicit ConfigTree(PTree&&, std::string const&, + Callback const&, Callback const&) = delete; //! copying is not compatible with the semantics of this class ConfigTree(ConfigTree const&) = delete;