From: Daniel Arndt Date: Mon, 8 Apr 2019 21:19:12 +0000 (+0200) Subject: Fix ambiguous function call X-Git-Tag: v9.1.0-rc1~213^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=036cb4fa105161ae5caacb5b28855ea84473b622;p=dealii.git Fix ambiguous function call --- 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); }