Namespaces
Variants
Views
Actions

Talk:cpp/keyword

From cppreference.com

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)

Contents

[edit] 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)

[edit] 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 <ref> --Bazzy 01:07, 9 March 2012 (PST)

[edit] 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)

[edit] about mark (1) and (2)

(1) 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.

[edit] Definition of a keyword

There are two differences between our definition of a keyword and the standard's. First, the alternative tokens (e.g and) are not considered keywords (Table 5 in C++20) but operator-and-punctuators (Table 6). This difference matters, since members of Table 6 cannot appear in attribute-tokens, 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 import-keyword, module-keyword and export-keyword. 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 and module are definitely C++ language keywords --Cubbi (talk) 13:31, 25 May 2023 (PDT)
That's fair. Especially when it comes to module, I completely agree. However, keywords can still appear in attribute-tokens (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)

[edit] (TM TS) et. al.

What does (TM TS) mean? It's used like (C++11), which means it was introduced with some version of C++. --172.70.246.217 06:41, 26 June 2023 (PDT)

"TM" - Transactional Memory
"TS" - Technical Specification.)               --Space Mission (talk) 10:13, 26 June 2023 (PDT)