On Tuesday February 21 2012, Thiago Macieira wrote:
> On terça-feira, 21 de fevereiro de 2012 10.33.12, Marc Mutz wrote:
> > 2. Add static QString::{v,}asprintf()
>
> Do we need them? You can't pass non-POD via ellipsis, so it's not very easy
> to use. I'd much rather you invested time in a C++-style formatting.
>
> We already have QString::arg().qlogging.cpp would be quite a bit more complicated without it... I also need some function to back up sprintf() so QT_NO_DEPRECATED builds remain BiC. On a more general line: QString::sprintf() is the only implementation of a printf-style formatter in Qt that allocates its target string, and therefore doesn't suffer from the problems of all other functions (except asprintf) about buffer lengths. Look at http://linux.die.net/man/3/vsnprintf, make_message Example, to see how horrendous correct implementation of an arbitrary-length version of printf() otherwise is. Bottomline: until we can expect variadic template support for Qt, I think we need to keep it. Many people have over the years tried to eradicate printf, but it's syntax is just too compact. Thanks, Marc -- Marc Mutz <[email protected]> | Senior Software Engineer KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company www.kdab.com || Germany +49-30-521325470 || Sweden (HQ) +46-563-540090 KDAB - Qt Experts - Platform-Independent Software Solutions
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
