Details
-
Bug
-
Resolution: Done
-
P4: Low
-
5.1.0
-
None
-
8fd3d53a93d50506a0c3fa620e560cf1b03ba3c0
Description
The inline QByteArray(QByteArrayDataPtr dd) constructor defined in QtCore/qbytearray.h does:
reinterpret_cast<Data *>(dd.ptr)
As you know, reinterpret_cast is a rather "brute force" way of casting. In this particular case, it may also cause a compiler warning, when using Visual C++:
warning C4946: reinterpret_cast used between related classes: 'QArrayData' and 'QTypedArrayData<T>'
So in this case, it seems more appropriate to do static_cast.