Liste des Groupes | Revenir à cl c |
On 23/05/2024 02:21, Thiago Adams wrote:Fortunately, it is /not/ actually implemented like that - it is only implemented "as if" it were like that. Real prototype implementations (for gcc and clang - I don't know about other tools) are extremely efficient at handling #embed. And the comma-separated numbers can be more flexible in less common use-cases.Em 5/22/2024 7:53 PM, Keith Thompson escreveu:'embed' was discussed a few months ago. I disagreed with the poor way it was to be implemented: 'embed' notionally generates a list of comma-separated numbers as tokens, where you have to take care of any trailing zero yourself if needed. It would also be hopelessly inefficient if actually implemented like that.But const doesn't mean constant. It means read-only.>
`const int r = rand();` is perfectly valid.
>
I dislike the C++ hack of making N a constant expression given
`const int N = 42;`; constexpr made that unnecessary. C23 makes the
same (IMHO) mistake.
>
If I had a time machine, I'd spell "const" as "readonly" and make
"const" mean what "constexpr" now means (evaluated at compile time).
>
[...]
Everything is a mess: const in C++, the differences from const in C, etc. constexpr in C23 just makes the mess bigger.
>
auto is a mess as well not well specified for pointer. not sure if we had this topic here, but auto * p in C is not specified.
>
I would remove from C23
- nullptr
-auto
-constexpr
-embed
>
I like the idea of embed but there is no implementation in production so this is crazy!
Les messages affichés proviennent d'usenet.