Eliminate more pass-by-value in variadic calls

This commit is contained in:
Eelco Dolstra 2019-12-05 18:23:32 +01:00
parent 603b2f583c
commit 092af3c826
2 changed files with 4 additions and 4 deletions

View file

@ -97,14 +97,14 @@ public:
unsigned int status = 1; // exit status
template<typename... Args>
BaseError(unsigned int status, Args... args)
BaseError(unsigned int status, const Args & ... args)
: err(fmt(args...))
, status(status)
{
}
template<typename... Args>
BaseError(Args... args)
BaseError(const Args & ... args)
: err(fmt(args...))
{
}
@ -136,7 +136,7 @@ public:
int errNo;
template<typename... Args>
SysError(Args... args)
SysError(const Args & ... args)
: Error(addErrno(fmt(args...)))
{ }

View file

@ -299,7 +299,7 @@ public:
int status;
template<typename... Args>
ExecError(int status, Args... args)
ExecError(int status, const Args & ... args)
: Error(args...), status(status)
{ }
};