mercredi 23 novembre 2016

Standard replacement for QByteArray

I want to port a Qt C++11 function to standard C++11. The function has a QByteArray parameter that accepts any kind of data (text, binary data, etc.) using a QByteArray parameter and calculates a hash from the data.

QByteArray seems well suited because it can carry any kind of data and has a lot of functions that allow filling it from streams, devices, strings, etc. It even can wrap data without doing a deep copy using fromRawData().

Is there a standard C++11 solution that provides similar flexibility? Currently I tend to use good old void* plus size.

Aucun commentaire:

Enregistrer un commentaire