[Development] Another integer typedef OR how to prepare for 64-bit in Qt 5

Thiago Macieira thiago.macieira at intel.com
Fri Nov 2 15:56:26 CET 2018


On Friday, 2 November 2018 00:06:12 PDT Иван Комиссаров wrote:
> I vote for 3. The (small) argument is: with qint one cannot write an
> algorithm taking std:: class (std::vector<uchar>) and a Qt class but with
> size_type it can.
> 
> Something like
> template<typename T> T::size_type * getSize(const T &t) { return t.size(); }
> auto d1 = getSize(std::vector<uchar>()); // ok
> auto d2 = getSize(QString()); // ok
> 
> Seeing size_type in doc is OK - the users will be aware that it may vary
> depending on Qt ver.

size_type would be defined for the Qt types anyway, so your argument does not 
exclude #4.

What do you suggest we do for QImage?

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center






More information about the Development mailing list