Do not return a const& for Named Parameters' default values

Since 'd' is in general some default constructed value, things can get weird,
for example with default constructed std::function
This commit is contained in:
Mael Rouxel-Labbé 2019-07-23 11:58:21 +02:00
parent 4ca465a81f
commit ae44cf3ff9
1 changed files with 1 additions and 2 deletions

View File

@ -204,8 +204,7 @@ get_parameter(const Named_function_parameters<T, Tag, Base>& np, Query_tag tag)
} }
template <typename D> template <typename D>
const D& D choose_parameter(const internal_np::Param_not_found&, const D& d)
choose_parameter(const internal_np::Param_not_found&, const D& d)
{ {
return d; return d;
} }