Skip to content

Commit

Permalink
Fix: Passing args in "libdnf5::Error" and "libdnf5::SystemError" ctors
Browse files Browse the repository at this point in the history
"move" semantics now works for rvalue arguments.
  • Loading branch information
jrohel committed Oct 19, 2023
1 parent d22ec04 commit a5f7691
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/libdnf5/common/exception.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ class Error : public std::runtime_error {
///
/// @param format The format string for the message.
/// @param args The format arguments.
template <typename... Ss>
explicit Error(BgettextMessage format, Ss &&... args)
template <typename... Args>
explicit Error(BgettextMessage format, Args... args)
: std::runtime_error(b_gettextmsg_get_id(format)),
format(format),
// stores the format args in the lambda's closure
Expand Down Expand Up @@ -172,9 +172,9 @@ class SystemError : public Error {
/// @param error_code The `errno` of the error.
/// @param format The format string for the message.
/// @param args The format arguments.
template <typename... Ss>
explicit SystemError(int error_code, BgettextMessage format, Ss &&... args)
: Error(format, std::forward<Ss>(args)...),
template <typename... Args>
explicit SystemError(int error_code, BgettextMessage format, Args... args)
: Error(format, std::forward<Args>(args)...),
error_code(error_code),
has_user_message(true) {}

Expand Down

0 comments on commit a5f7691

Please sign in to comment.