From 036cb4fa105161ae5caacb5b28855ea84473b622 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Mon, 8 Apr 2019 23:19:12 +0200 Subject: [PATCH] Fix ambiguous function call --- .../deal.II/algorithms/general_data_storage.h | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/include/deal.II/algorithms/general_data_storage.h b/include/deal.II/algorithms/general_data_storage.h index 30228b9ffa..07d9075e60 100644 --- a/include/deal.II/algorithms/general_data_storage.h +++ b/include/deal.II/algorithms/general_data_storage.h @@ -244,9 +244,11 @@ public: * arguments. For this function, the @p arguments are passed as * lvalue references. */ - template + template Type & - get_or_add_object_with_name(const std::string &name, Args &... arguments); + get_or_add_object_with_name(const std::string &name, + Arg & argument, + Args &... arguments); /** * Return a reference to the object with given name. If the object does @@ -258,9 +260,11 @@ public: * arguments. In contrast to the previous function of the same name, for * this function the @p arguments are passed as rvalue references. */ - template + template Type & - get_or_add_object_with_name(const std::string &name, Args &&... arguments); + get_or_add_object_with_name(const std::string &name, + Arg && argument, + Args &&... arguments); /** * Return a reference to the object with given name. @@ -443,25 +447,29 @@ GeneralDataStorage::get_object_with_name(const std::string &name) const } -template +template Type & GeneralDataStorage::get_or_add_object_with_name(const std::string &name, + Arg & argument, Args &... arguments) { if (!stores_object_with_name(name)) - add_unique_copy(name, Type(arguments...)); + add_unique_copy(name, Type(argument, arguments...)); return get_object_with_name(name); } -template +template Type & GeneralDataStorage::get_or_add_object_with_name(const std::string &name, + Arg && argument, Args &&... arguments) { if (!stores_object_with_name(name)) - add_unique_copy(name, Type(std::forward(arguments)...)); + add_unique_copy(name, + Type(std::forward(argument), + std::forward(arguments)...)); return get_object_with_name(name); } -- 2.39.5