Talk:cpp/keyword

Some keywords appear in C++ 11. But which version of C++ Builder do they appear in?
 * this is a reference for standard C++, for info on specific implementations, refer to their own documentation --Bazzy 01:07, 9 March 2012 (PST)

The Meaning
What is the meaning of "todo"?


 * it means one section is incomplete and needs someone to edit this. JK19 (talk) 04:47, 18 February 2021 (PST)

On the Page
What is the meaning of "1"?
 * It's a footnote pointing to * (1) - meaning changed in C++11. Maybe it would be better to change it into a --Bazzy 01:07, 9 March 2012 (PST)

Examples in keywords
What about adding examples only at language/*** pages the keywords refer to? Each of the keyword/*** pages just lists available contexts for a particular keyword, which are then described in detail at language/***. A keyword by itself is quite meaningless, since a context is always needed to define how it'll behave or whether it's allowed to be there at all. Since there's almost no information about the contexts at keyword/*** pages, I think a better option would be to move examples to the language/*** pages. -- P12 01:56, 2 May 2012 (PDT)
 * I liked the example in keyword/class since it neatly juxtaposes the different uses of the keyword. But then I tried making up examples for single-use keywords, and I have to agree that they do not work or have better examples in the corresponding language/ pages. --Cubbi 02:45, 2 May 2012 (PDT)
 * Perhaps multi-use keyword pages could have short examples that focus on highlighting the different use cases, leaving more thorough examples to the language pages?--Nate 06:38, 2 May 2012 (PDT)

Thank you to creators + editors. You saved my sanity (or at least delayed its loss (including my remaining hair)). I never knew that there were "Identifiers with special meaning". Next challenge...forget it, I will make them keywords "final" and "override" keywords in my version of a parser for non-C++ displays.Cbcalvin 15:52, 21 September 2012 (PDT)

about mark (1) and (2)
means meaning has changed or added new meaning in C++11, but how to define 'change' and 'add new meaning'? e.g. class added new meaning because of 'enum class', so did 'struct', and even 'enum'?. so I think 'constexpr' and 'if' also has added new meaning in C++17 because of 'if constexpr', so 'typename' has changed twice: in C++17, it can use in template template parameter, and in C++20, it can use in concepts requirements.'auto' changes&adds new meaning everywhere in C++11 in C++14 in C++17 and even in C++2a(maybe).how terrible! so I think we shouldn't just mark like these.we need to find out a better way.

Definition of a keyword
There are two differences between our definition of a and the standard's. First, the alternative tokens (e.g ) are not considered s (Table 5 in C++20) but s (Table 6). This difference matters, since members of Table 6 cannot appear in s, unlike members of Table 5 (at least, that's my reading of 5.11, gcc and clang allow them anyway). The reason I'm reluctant to just remove them from the list of keywords is that they also have keyword pages (cpp/keyword/and). Should these be deleted? Should their titles be changed to remove the words "C++ keyword" instead?

The second difference is in the keywords used for modules. These are, and. To be honest, I think we should not include them since they are not in Table 5, and most importantly, they are only used internally by the compiler, if even, and don't concern the programmer at all. In my opinion, as long as they aren't mentioned in the modules page, they shouldn't be mentioned here either, but I bring attention to them anyway in case someone disagrees. --172.68.62.153 05:16, 24 May 2023 (PDT)


 * cppreference's audience are not formal language provers or ISO historians. To a programmer, and  are definitely C++ language keywords --Cubbi (talk) 13:31, 25 May 2023 (PDT)


 * That's fair. Especially when it comes to, I completely agree. However, keywords can still appear in s (which this page doesn't mention for some reason) (EDIT: I added it. I also added a sentence about the alternative tokens) and alternative representation keywords cannot. This is what happens in MSVC if iso646.h is included. And while that is not standard compliant, one can make the argument that gcc and clang, which allow these keywords in attributes, are also not standard compliant in a different way. So, the way I see it is, you're right that cppreference should call alternative tokens keywords, but it should also acknowledge the difference that exists between them and regular keywords since it can, in principle at least, matter to a programmer. --172.68.62.135 08:27, 26 May 2023 (PDT)