Closed hmoffatt closed 1 year ago
Qt5's QVector::reserve takes an int (See https://doc.qt.io/qt-5/qvector.html#reserve), while std's containers and Qt6 for that matter too takes a size_t (https://doc.qt.io/qt-6/qlist.html#reserve). Not sure what to do about it, besides maybe adding the size type to the template parameter:
template <typename Container, typename Size> bool reserve_helper(Container &container, Size size, std::true_type) { container.reserve(size); return true; }
Not sure what can of worms that would open though.
Can you use Container::size_type
?
I'm using kdalgorithms with Qt 5.15.12.
The following code generates warnings in Visual Studio about the type of
size
in reverse_helper.h: