As a Windows C++ dev, I’d love to see a win64 API declared which updates to sizeof(int)=sizeof(void*), unsigned char, utf8 only (using new codepage), straight API declarations in one header per Windows DLL with no macro hackery.
-
-
The C++ standards committee apparently agrees with you that size_t was a mistake, in particular its unsignedness (which I presume is the source of most conversion issues). https://github.com/Microsoft/GSL has gsl::index which is signed. Sadly too late to fix the STL I guess.
-
I’d love to see a one time breaking change that fixes all of this stuff both in the ISO standard and in platform defaults. So much of this stuff is just dumb.
- 7 more replies
New conversation -
-
-
The ship has sailed for C, unfortunately: no matter what MSVC does, you have to assume sizeof(int) might not be the same as sizeof(void*) to be portable.
-
And if you use intptr_t/int32_t/int64_t everywhere, then you only need to worry about portability to different pointer sizes, not to arbitrary permutations of sizeof(int) and sizeof(void*). Makes it harder to screw up the conversions.
- 4 more replies
New conversation -
-
-
You did mean unsigned right? I don’t mind size_t but usually I typedef my types to u64/i64 and u32/i32 respectively. Intptr is special though I usually try to use void* or byte* and very rarely fallback to uintptr. What’s good is that the compiler will warn if sizes don’t match.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
