Placing template in a QByteArray
-
wrote on 4 Mar 2012, 04:43 last edited by
Let's take this as an example:
@template<typename ...Parameters>
void MyClass::MyFunction(Parameters&&... parameters)
{
QDataStream myDStream;
}@I want to put the template stuff inside the QDataStream. How is possible to do this?
-
wrote on 4 Mar 2012, 11:20 last edited by
For Qt standard variables there are alreday "output operators":https://qt-project.org/doc/qt-4.8/qdatastream.html#operator-lt-lt defined.
Others you have to write your own overlayed output operators. -
wrote on 4 Mar 2012, 22:18 last edited by
Have a look into "this older thread":/forums/viewreply/22324/, there's a sample on how to write your own operator overloads for QDataStream.
-
wrote on 5 Mar 2012, 05:47 last edited by
Well, actually when doing myDStream << (parameters)... compiler cryes about the "..." but if i remove them, cryes about not having them.
-
wrote on 5 Mar 2012, 06:56 last edited by
So... how did you declare and implement your QDataStream operator overloads?
2/5