This may seem foolish to some - but I have a metric ton of C-style printf code to maintain.
We could rebuild it all using boost's formatting libraries, and perhaps we'll get to it one of these days. However, in the meantime, just being able to distinguish on one argument, or one + one-or-more arguments is a huge step forward.
https://stackoverflow.com/users/365496/bames53 noted that is is possible to do so, and it appears to work (at some possible expense in code bloat, and with the caveat that this is still printf land with all of its pitfalls).
Here is a simple example that does it's job in MFC/C++:
bool Write(const wchar_t * pszText);
template <typename T> bool Write(const wchar_t * pszFormat, T, ...);
Write need not (and should not) call vwsprintf equivalent, while Write<> does do so in order to build the output string before passing it on to Write.
Very elegant. Removes the problem of either only providing the second interface (and then you get printf problems if your one string happens to have an accidental printf format specifier in it), or forcing clients to specify Write() vs. WriteFormat() or similarly do the string construction locally before calling Write().
Here's Write<> defined in terms of Write:
template <typename T> bool SimpleTextFile::Write(const wchar_t * pszFormat, T, ...)
{
va_list arglist;
va_start(arglist, pszFormat);
CStringW buffer;
buffer.FormatV(pszFormat, arglist);
va_end(arglist);
return Write(buffer);
}