Declare a char8_t variable with a character, say 'a', and VS vomits up an error with
std::cout << c8t << '\n';
. operator<< is a deleted function for a naked char8_t. It has to be cast to work.
std::cout << static_cast<char>(c8t) << '\n';
If'n you want numeric output:
std::cout << +c8t << '\n';
Or cast to an int.
VS and MinGW/GCC exhibits the same behavior with the other fixed width char types as well if I don't manipulate the variable with a cast or adding + prefix, operator<< is a deleted function for all 3 of the fixed width char types.
My C:B copy uses MSYS2's MinGW 12.2, so I know this isn't a VS-only issue.
This "jumping through hoops" is one reason why I never seem to get any of the fixed length char types to work without a lot of extra effort. Effort I usually forget to do and so I don't use the the fixed width char types.
Somewhere along the line the specifications for std::cout kinda fell by the wayside and ignored as the standard introduced the fixed width char types starting with C++11. If std::cout exhibited the same behavior with the fixed with char types as the regular char type, no need for a cast to display a character, that would be understandable and useful.
MinGW is a Windows port of the GCC compiler.
https://stackoverflow.com/questions/38252370/what-is-the-difference-between-gnu-gcc-and-mingw-arent-they-same
There are some patches done on GCC with MinGW to make it work better with Windows.
There are a couple of MinGW variants: MinGW, MinGW-64 & TDM-GCC.
If'n you don't do Windows you don't need to worry about this.
Since I do do Windows this is of vital importance to me if I want to use the GCC toolchains.
The current release candidate version of GCC is 12.2, released 19 August 2022.