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.
ut ACK
Looks like there is another tinyformat-related c++1 TODO here: https://github.com/bitcoin/bitcoin/blob/master/src/util.h#L83
utACK 9eaa0af
utACK 9eaa0afa6ec5d3dd01e4d01121314ef51f2bc305
Added a second commit that makes LogPrint and error into variadic templates.
may as well use perfect forwarding here, since all args are universal references:
template<typename T1, typename... Args>
bool error(const char* fmt, T1&& v1, Args&&... args)
{
LogPrintStr("ERROR: " + tfm::format(fmt, std::forward<T1>(v1), std::forward<Args>(args)...) + "\n");
...
@cfields I use the same convention as the functions in tinyformat.h itself now:
template<typename T1, typename... Args>
std::string format(const char* fmt, const T1& v1, const Args&... args)
{
std::ostringstream oss;
format(oss, fmt, v1, args...);
return oss.str();
}
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.