News for hackers. Stuff that matters.
Re:About size_t and ptrdiff_t by aCthrowa on Tuesday August 18, 2015 @01:24PM (#10080601)
This may be practically correct, but is semantically very very wrong.

size_t represents the size of objects in memory. So of course it scales with virtual memory space.

ssize_t is like size_t (same width), but signed. It's useful for routines that want to return a size_t or error (network routines like send/recv).

ptrdiff_t is specifically for the result of subtracting one pointer from another. Obviously it scales with pointer size as well.

Re:About size_t and ptrdiff_t by tomvbussel on Tuesday August 18, 2015 @01:29PM (#10080649)
ssize_t is not a part of the C++ standard, sadly.
Re:About size_t and ptrdiff_t by throwaCagain on Tuesday August 18, 2015 @01:31PM (#10080673)
Just POSIX :).
Re:About size_t and ptrdiff_t by ben0x539 on Tuesday August 18, 2015 @01:30PM (#10080666)
ssize_t isn't standard C so it doesn't get you very far for portability.
Re:About size_t and ptrdiff_t by throwaCagain on Tuesday August 18, 2015 @01:35PM (#10080709)
POSIX gets you pretty far.