Why in anyone's name would trolltech decide to use int (or uint or whatever) instead of the great and portable size_t? I understand there's really no need and all, but for the elegance and future portablility such a change is really nothing?
Why in anyone's name would trolltech decide to use int (or uint or whatever) instead of the great and portable size_t? I understand there's really no need and all, but for the elegance and future portablility such a change is really nothing?
Isn't size_t a C (or even Posix/Linux/whatever) type? C++ doesn't use size_t, as far as I know.
C++ does use size_t, and size_t is normally implemented on a platform basis. 'int' is bad form as it doesn't specify the size (it could be 8, 16, 32 or 64 bits, depending on platform), and can't be changed on a platform basis. eg. when 'int' is 16-bits, but it's perfectly acceptable to move > 64KB of data, you can't change it to 'unsigned long' easily where you can with size_t.
Considering how much Qt is multi-platform, I am suprised it doesn't use size_t, but as of yet, I've not had a problem, as it's always ARM and above, so 'int' is always at least 32-bits.
True, I just grepped my includes
Maybe some (one?) of the supported platform does (used to?) have size_t defined incorrectly?Considering how much Qt is multi-platform, I am suprised it doesn't use size_t, but as of yet, I've not had a problem, as it's always ARM and above, so 'int' is always at least 32-bits.
BTW. It seems that Qt does use size_t in some places. So maybe this is just a mistake made in 4.0 and now it's all about providing backwards compatibility.
The reason I answer is pure rage.
Of course there is std::size_t (in the header cstddef for instance), in fact its a very important builtin type and it exists since the first official standard from 1998.C++ does use size_t
I cannot believe to see
Qt Code:
To copy to clipboard, switch view to plain text mode
This is simply wrong, not just horribly bad, its wrong! I am now suffering from problems related to that - don't ask why there is a need for more than 2GB in a string, there just is.
As I can see, all of Qt's code is full of such things, its horrible!
File a bug report. These things -do- get fixed, especially if you can provide a valid use case for the change.
You also have the Qt source code, so you can make the change yourself if the wheels at The Qt Company turn too slowly for you.
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
Bookmarks