Content deleted Content added
→Is decltype an operator?: new section |
|||
Line 400:
== Is <code>decltype</code> an operator? ==
The C23 standard adds the operators <code>typeof</code> and <code>typeof_unqual</code> and refers to them as operators by name (ISO/IEC 9899/2023 6.7.2.5 Typeof specifiers says: "The typeof and typeof_unqual tokens are collectively called the typeof operators.") While neither operator is in C++ yet, they will almost certainly be added to C++26 for compatibility and the proposal that does so, [https://wg21.link/p2958 p2958], groups them together with <code>decltype</code>, which makes sense. However, I can't find any source that refers to <code>decltype</code> as an "operator". In the [[decltype]] page one of the references is called [http://msdn.microsoft.com/en-us/library/dd537655(VS.100,loband).aspx decltype operator], but that name has since been changed to "decltype Type Specifier". (EDIT: Some examples of the phrase "decltype operator" I found: [https://github.com/MicrosoftDocs/cpp-docs/blob/main/docs/cpp/decltype-cpp.md] [https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Type_Specifier_decltype_(C%2B%2B11)] and [https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf the original paper that proposed it]. I think the fact that the people who defined decltype in the first place called it an operator is enough to settle the question, but I'll leave this here in case someone disagrees. --19:42, 30 October 2023 (UTC))
So, the question is: Should <code>decltype</code> be added to the list of operators? My opinion is that it should, since it does basically the same thing as the typeof operators, so I will be adding it to the page for consistency, but feel free to revert if you can come up with a good counterargument. [[User:Nickps|Nickps]] ([[User talk:Nickps|talk]]) 18:07, 30 October 2023 (UTC)
|