I found my friend's Qt code and he uses the modulo operator on two QStrings like this:
QString result = oneString % twoString;
What does it mean?
It's just another (more efficient) way to concatenate QStrings as described in the manual
QStringBuilder uses expression templates and reimplements the '%' operator so that when you use '%' for string concatenation instead of '+', multiple substring concatenations will be postponed until the final result is about to be assigned to a QString. At this point, the amount of memory required for the final result is known. The memory allocator is then called once to get the required space, and the substrings are copied into it one by one.
QString implementation to use the technique for the + operator. Presumably, it could break existing code - any idea what kind of existing code might be broken by such a change? (note that the docs describe a macro configuration that will make it so + will use the the new technique, saying that it "is the most convenient but not entirely source compatible").+ is QStrings's operator, while % is external to QString. Replacing first with second will break binary compatibility..pro file: DEFINES *= QT_USE_QSTRINGBUILDER and the + will automatically be performed as the QStringBuilder % everywhere."It is Qt specific way of string construction. Take a look on this page.
QStringBuilder uses expression templates and reimplements the '%' operator so that when you use '%' for string concatenation instead of '+', multiple substring concatenations will be postponed until the final result is about to be assigned to a QString. At this point, the amount of memory required for the final result is known. The memory allocator is then called once to get the required space, and the substrings are copied into it one by one.