How is this a most vexing parse?

Rectangle s(origin()); is a vexing parse too. It declares a function s which returns rectangle, and takes as argument pointer to function returning origin. Not sure what you meant by “works fine”. rectangle w( origin(), extents() ); declares a function w returning rectangle and taking arguments: pointer to function returning origin, and pointer to function … Read more

Most vexing parse [duplicate]

what does this syntax int(x) in the statement Foo f( int(x) ); mean? The parentheses around x are superfluous and will be ignored. So int(x) is the same as int x here, which means a parameter named x with type int. Is it the same as Foo f( int x );? Yes. Foo f( int(x) … Read more

Most vexing parse

This is due to the fact that TimeKeeper time_keeper(Timer()); is interpreted as a function declaration and not as a variable definition. This, by itself, is not an error, but when you try to access the get_time() member of time_keeper (which is a function, not a TimeKeeper instance), your compiler fails. This is how your compiler … Read more