r/C_Programming • u/Jinren • Feb 23 '24
Latest working draft N3220
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf
Update y'all's bookmarks if you're still referring to N3096!
C23 is done, and there are no more public drafts: it will only be available for purchase. However, although this is teeeeechnically therefore a draft of whatever the next Standard C2Y ends up being, this "draft" contains no changes from C23 except to remove the 2023 branding and add a bullet at the beginning about all the C2Y content that ... doesn't exist yet.
Since over 500 edits (some small, many large, some quite sweeping) were applied to C23 after the final draft N3096 was released, this is in practice as close as you will get to a free edition of C23.
So this one is the number for the community to remember, and the de-facto successor to old beloved N1570.
Happy coding! 💜
View all comments
Show parent comment
2
u/mccurtjs Jun 06 '24
Calling it typename is actually kind of a brainfart on my end - I'm not so much thinking of a use associated with that keyword in C++, but just a way to get the name of a type as a string (as a literal at compile time, similar to how
typeofworks in Javascript, but nothing dynamic). A better C++ parallel would actually betypeid.The use case I'm thinking of is for passing a value via void pointer to some processing function with a second argument denoting the type, and the function then casts and processes it based on the given type. Currently it's doable with something like
but it gets unwieldly very quickly, lol (especially when handling pointer types, and differentiating between pointer and array types).
Of course, with other changes/additions for polymorphism, something like this might just be redundant? I'm curious where you'd stand on a feature like this, since you seem to be much more in the weeds of C's language design.