@TheIdeasMan, happens to me all the time. One compiler happily consumes code and another gets nauseous and vomits all over the place. :)
"ssize_t is POSIX only" is one of they reasons why I use VS and a GCC/MinGW compiler to test code. To "catch" such little things.
I sure do wish the C++ ISO Committee would approve std::ssize_t for the standard. It shouldn't be that much work to add it to an implementation, and code that used std::size_t/std::ptrdiff_t should still work.
Previous invocations of this paper used only z and uz/zu, mostly because there was no named type that represented what a signed std::size_t or an unsigned std::ptrdiff_t was. This made it awkward to place into the C++ wording for the author writing this paper. However, Core Wording experts (thanks Hubert Tong and Jens Maurer!) have helped elucidate that while the type may not have a formal name or type alias in the language, it is perfectly valid to say "the unsigned/signed integer type corresponding to {X}".
emphasis by me :+)
Btw the MS compiler does not seem to have support for the integer literal suffix yet. It's pretty early days for c++23.
The other thing that bugs me is that I thought the motivation for a signed size_t was to use it for things like ranges, but ssize() and similar don't seem to use it. They use std::ptrdiff_t ?
Btw the MS compiler does not seem to have support for the integer literal suffix yet. It's pretty early days for c++23.
Since C++23 hasn't been officially adopted I am not surprised by this.
I am more than happy for a change MS/Visual Studio is actually fully compliant at this time with the current C++ standard, while GCC/MinGW/TDM are still lagging behind.
I don't remember the specifics....I do remember when VS was considered a joke for taking so long to even partially support C++11. The free Express versions were....a mess. Paying for a pro/enterprise edition was not a wise investment.
These days the committee and the implementers are pretty good at sticking to the 3 year cycle. Back in c++11, clang was winning; g++ was second; and MS a distance third. Since then g++ and MS have undergone considerable reorganisation.
Looking at the compiler support table, I was wondering what the current version of visual studio is? A search only gives 2022. Is it somewhere around 19.29?
For char arrays shorter than PTRDIFF_MAX, ptrdiff_t acts as the signed counterpart of size_t: it can store the size of the array of any type and is, on most platforms, synonymous with intptr_t).
The issue with C++ back in the days of C++11 was the structure/design/code of the MS compiler. It was still based on the design used for floppy disks when you could compile without a hard-drive and just change the floppy disc when moving between the compiler stages... Sometime around 13/15 (?) the compiler was re-written, a lot of issues were resolved and it was made much easier to add new features.
I was wondering what the current version of visual studio is? A search only gives 2022. Is it somewhere around 19.29
The current version is 17.0.6 (VS2022). 17.1.0 is in preview.