[Interest] Using QT and boost unit test: problem with QString

Konstantin Tokarev annulen at yandex.ru
Fri Sep 21 12:04:02 CEST 2012

21.09.2012, 14:01, "Heidler, Kirstin (GE Oil & Gas)" <Kirstin.Heidler at ge.com>:
> I have to use boost unit test (not my choice). QT unit tests were working fine.
> I have the problem, that somewhere boost wants to append a const QString to an ostream.(I do not exactly know where this call occurs, since it is hidden in macros, but I know it is for writing a log file)
> So I get the compile error C2697:  binary operator '<<': no operator found which takes a right-hand operand of type ‘const QString’ (or there is no acceptable conversion).
> I don’t want to change boost source files. Is there another way to resolve this error?

The beautiful thing about operator overloading is that you don't have to modify library sources. You just define your own operator<< in your code, and that's all.


More information about the Interest mailing list