Talk:Operators in C and C++: Difference between revisions

Content deleted Content added
m Reverted edits by 102.91.4.155 (talk) to last version by Afernand74
 
(3 intermediate revisions by 2 users not shown)
Line 203:
 
:The keyword '''typeof''' is a non-standard extension to the C++ language. A similar feature will be provided by the '''decltype''' keyword in [[C++0x]]. The '''throw''' keyword is a standard part of the C++ language. That said, not all keywords are operators, and I am fairly certain that neither '''decltype''' nor '''throw''' would be considered to be operators. ← <span style="font-family: serif;"><b>[[User:Michael Safyan|Michael Safyan]]</b></span><sup>&nbsp;([[User talk:Michael Safyan|talk]])</sup> 02:17, 8 May 2008 (UTC)
::It's a bit confusing, but while [[decltype]] is not explicitly referred to as an operator in the WP, the term "<ttcode>decltype</ttcode> operator" is frequently used in the proposals. <span style="font-family:monospace, monospace;">[[User:Decltype|decltype]]</span> ([[User talk:Decltype|talk]]) 17:15, 16 September 2009 (UTC)
 
: "throw" behaves as any other operator, except that it returns void type. The conditional operator has a special case for one operand being a throw-expression, such that "false? 3 : throw xyz()" is an expression of type int that never completes evaluation. [[User:Potatoswatter|Potatoswatter]] ([[User talk:Potatoswatter|talk]]) 09:43, 15 June 2010 (UTC)
Line 221:
 
I see that once again "this" has been removed. Even if technically not an operator, I think it should be here somehow, because I think many will try to find it here. At least could we have a discussion about it instead of an edit war. [[User:SimonTrew|SimonTrew]] ([[User talk:SimonTrew|talk]]) 17:34, 27 February 2009 (UTC)
:Yes, I considered adding a comment on the talk page. But I felt that my edit comment would be enough to settle the issue: '''''removed "this" from the table, per [class.this]/1 of the standard'''''. <ttcode>this</ttcode> is not an operator, so I think it's just confusing to have it in a list of operators. Possibly a mention at the bottom of the article, but not in the actual table. Just my 5c. <span style="font-family:monospace, monospace;">[[User:Decltype|decltype]]</span> 19:06, 27 February 2009 (UTC)
 
::Yeah I was kinda thinking the same myself. But actually I am coming round to your opinion and wonder if it is justified at all in this article, it's not difficult to search for. I'm just quite a fan of making cross-references, I think that is part of what gives Wikipedia its value. [[User:SimonTrew|SimonTrew]] ([[User talk:SimonTrew|talk]]) 06:57, 28 February 2009 (UTC)
Line 295:
== Overload prototypes ==
 
There's no indication of what the type "R" means. [[User:OrangeDog|OrangeDog]] &nbsp;<small>([[User talk:OrangeDog|τ]] &nbsp; &nbsp;[[Special:Contributions/OrangeDog|ε]])</small> 10:33, 23 June 2010 (UTC)
 
== Compound literals missing ==
Line 322:
From [[Operators_in_C_and_C%2B%2B#Notes]]:
 
"* For example, <code>++x*3</code> is ambiguous without some precedence rule(s). The precedence table tells us that: <ttcode>x</ttcode> is 'bound' more tightly to <ttcode>++</ttcode> than to <ttcode>*</ttcode>, so that whatever <ttcode>++</ttcode> does (now or later—see below), it does it ONLY to <ttcode>x</ttcode> (and not to <code>x*3</code>); it is equivalent to (<code>++x</code>, <code>x*3</code>)."
 
<s>This looks like it is saying that <code>++x*3</code> is equivalent to <code>(++x, x*3)</code>. Which is incorrect: with the comma operator, the arguments can be evaluated in any order.</s>