Koehne Kai wrote: > On quinta-feira, 9 de janeiro de 2014 07:28:07, Koehne Kai wrote: > > if qCWarning() would expand to an if (myCategory().isEnabled()) ... > > That's why it would have to expand to if (!myCategory().isEnabled()) {} else > > Well, we can't, since the << arguments are not part of the macro :) That > would end up with s.th. lie > > if (!myCategory().isEnabled()) { QMessageLogger(__FILE__, __LINE__, > __FUNCTION__).debug() {} else {} << "Hello World"; > > which doesn't compile.
This is only a problem because you insist on creating partial statements with the macro instead of full statements. If the "streaming syntax" would be qFoo(myCategory(), a << b << c); instead of qFoo(myCategory()) << a << b << c; there's no "else" to worry about, and it would also solve the problem of a "compile time" "null stream": #define qFoo(stream, stuff) /*nothing*/ We had this discussion before. Andre' _______________________________________________ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development