1. Problem statement
P1389, under 2.2.1.1. Primary types ([types.basic.primary]), suggest that post-
C++20 we should teach beginners to use for characters and for strings (instead of and in pre-C++20).
The author thinks this is wrong.
C++20 still has no tools to handle input and output with these types.
Even the new facilities doesn’t support it.
There is even no good conversion tools for it (and even the existing conversions,
like stuff, are deprecated since C++17).
The main usage of strings and characters is for input and output and C++20 still missing tools to do so with these types.
This paper suggests to remove the distinction between pre-C++20 and post-C++20 and reintroduce these types as soon as the proper tools are added (by SG16, hopefully for C++23).
2. Proposed Wording
Under 2.2.1.1. Primary types ([types.basic.primary]):
| Abstract type |
|
|
|---|---|---|
| Integer |
|
|
| Floating-point |
|
|
| Boolean |
|
|
| Character |
|
|
| String |
|
|
| Sequence container |
|
|
| Associative container |
|
|
char is insufficient in the current programming world: they
can just start using what they are already familiar with. 3. Acknowledgements
Thanks for Christopher Di Bella for mentioning the point about