Now that we started using c++11, force use of variadic templates.
The autodetection may be wonky on some compilers, see discussion here and is unnecessary for us anyhow.
Now that we started using c++11, force use of variadic templates.
The autodetection may be wonky on some compilers, see discussion
[here](https://github.com/bitcoin/bitcoin/pull/7982#issuecomment-216222357)
and is unnecessary for us anyhow.
may as well use perfect forwarding here, since all args are universal references:
0template<typename T1, typename... Args>
1bool error(const char* fmt, T1&& v1, Args&&... args)
2{
3 LogPrintStr("ERROR: " + tfm::format(fmt, std::forward<T1>(v1), std::forward<Args>(args)...) + "\n");
4...
@cfields I use the same convention as the functions in tinyformat.h itself now:
0template<typename T1, typename... Args>
1std::string format(const char* fmt, const T1& v1, const Args&... args)
2{
3 std::ostringstream oss;
4 format(oss, fmt, v1, args...);
5 return oss.str();
6}
I’m not sure perfect forwarding would win anything unless it’s done at all levels.
blah, I assumed if it used variadics it also forwarded nicely. Indeed, no point in changing.
ut ACK 08d7b563e91ed2ad226ec2505a5a850ab869d2f0
blah, I assumed if it used variadics it also forwarded nicely. Indeed, no point in changing.
Well I agree with changing it, but yea should probably do that at once throughout the entire thing, in a separate pull.