diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-12-05 18:23:32 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2019-12-05 19:58:52 +0100 |
commit | 092af3c82692cb346dfac0dcb1bafe46703682ca (patch) | |
tree | 912fffd0fdf8aebf70df8b74767b1c5d1cbdf347 /src/libutil | |
parent | 603b2f583c3be45481d2d0e45e8ee8bfa9cfbfcf (diff) |
Eliminate more pass-by-value in variadic calls
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/types.hh | 6 | ||||
-rw-r--r-- | src/libutil/util.hh | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/libutil/types.hh b/src/libutil/types.hh index 5d3e76421..20b96a85c 100644 --- a/src/libutil/types.hh +++ b/src/libutil/types.hh @@ -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...))) { } diff --git a/src/libutil/util.hh b/src/libutil/util.hh index b9f9ea882..a1acb49b5 100644 --- a/src/libutil/util.hh +++ b/src/libutil/util.hh @@ -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) { } }; |