diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-04-22 15:29:10 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-04-22 15:29:10 +0200 |
commit | 16e3bf453782eebb2270c9318b51f3ba2ad993fc (patch) | |
tree | e27912f39e693443ae4d9c60faabe5cbe87bff96 /src/libutil/types.hh | |
parent | 2ea4d45449ea676e27cc678145ef39af7ac05ca8 (diff) | |
parent | 12814806efca65a73aebf8d3109eb2fbf880e2b8 (diff) |
Merge branch 'error-format' of https://github.com/bburdette/nix
Diffstat (limited to 'src/libutil/types.hh')
-rw-r--r-- | src/libutil/types.hh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libutil/types.hh b/src/libutil/types.hh index a1ce7b372..250c9581d 100644 --- a/src/libutil/types.hh +++ b/src/libutil/types.hh @@ -41,7 +41,8 @@ struct FormatOrString { string s; FormatOrString(const string & s) : s(s) { }; - FormatOrString(const format & f) : s(f.str()) { }; + template<class F> + FormatOrString(const F & f) : s(f.str()) { }; FormatOrString(const char * s) : s(s) { }; }; @@ -51,12 +52,13 @@ struct FormatOrString ... a_n’. However, ‘fmt(s)’ is equivalent to ‘s’ (so no %-expansion takes place). */ -inline void formatHelper(boost::format & f) +template<class F> +inline void formatHelper(F & f) { } -template<typename T, typename... Args> -inline void formatHelper(boost::format & f, const T & x, const Args & ... args) +template<class F, typename T, typename... Args> +inline void formatHelper(F & f, const T & x, const Args & ... args) { formatHelper(f % x, args...); } |