Jump to content

Talk:Most vexing parse

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Magic sergeant (talk | contribs) at 04:23, 8 June 2018. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
WikiProject iconComputing: Software Stub‑class Low‑importance
WikiProject iconThis article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
StubThis article has been rated as Stub-class on Wikipedia's content assessment scale.
LowThis article has been rated as Low-importance on the project's importance scale.
Taskforce icon
This article is supported by WikiProject Software (assessed as Low-importance).
WikiProject iconC/C++ Unassessed Low‑importance
WikiProject iconThis article is within the scope of WikiProject C/C++, a collaborative effort to improve the coverage of C and C++ topics on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
???This article has not yet received a rating on Wikipedia's content assessment scale.
LowThis article has been rated as Low-importance on the importance scale.

NPOV

"extremely counterintuitive" ... NPOV anyone? I personally think it is the most appropriate way. A function returning T named f, taking nothing? T f();. no matter what context. —Preceding unsigned comment added by 213.61.9.74 (talk) 12:12, 24 January 2011 (UTC)[reply]

Agreed. I made an attempt at rewriting the lede. decltype (talk) 13:07, 24 January 2011 (UTC)[reply]

Explanation of Name

Where does the term "most vexing parse" come from? How exactly is it defined? A lot of space is currently devoted to examples, but there's not a lot of description of the actual definition of the concept. -- 140.142.20.101 (talk) 01:12, 6 March 2012 (UTC)[reply]


+1 to the above 2620:0:1042:0:D267:E5FF:FEEC:80D2 (talk) 18:30, 26 November 2013 (UTC)[reply]

Bad Example?

Regarding the "TimeKeeper time_keeper(Timer())" example: A) TimeKeeper time_keeper() is also MVP, so why complicate things? B) Programmers would write "Timer()" as void(*Timer)(), and it's surprising that it should be permitted to work the other way. In any case, without at least "void Timer()" on what systems does this compile? Not saying it's wrong, just a needlessly complicated/dubious example. --184.21.224.130 (talk) 19:53, 9 July 2016 (UTC) EDITED: I see, how strange; Timer is the return type with this syntax??? Why is this not banned by default. So is this specific example MVP? Because "TimeKeeper time_keeper()" is also vexing, in pretty much the same way. The most vexing thing about this is that "Timer()" is even a legal construction inside of the function signature (it's not permitted anywhere else.) --184.21.224.130 (talk) 20:05, 9 July 2016 (UTC)[reply]

Timer() is Timer (*)(), not void (*Timer)(). Magic sergeant (talk) 04:12, 8 June 2018 (UTC)[reply]

A function type (like ret_type (arg1_type, arg2_type)) as a parameter type automatically decays to a pointer-to-function type (in this case, ret_type (*)(arg1_type, arg2_type)), analogous to element_type [] decaying to element_type *. Magic sergeant (talk) 04:18, 8 June 2018 (UTC)[reply]

It is not allowed anywhere else because such decaying process does not occur anywhere else Magic sergeant (talk) 04:23, 8 June 2018 (UTC)[reply]