I was reading an SO post where one user made the following comment:
Also note that
ArrTest<int> ar();
uses most vexing parse.
But another user said the opposite:
ArrTest<int> ar();
is not the "most vexing parse". It's just a function declaration. It's certainly vexing for beginners, but, as the page you linked to indicates, the "most vexing parse" is more convoluted.
The code example from that post is given below for reference:
template <class ItemType>
class ArrTest {
public:
ArrTest();
private:
ItemType* info;
};
//some other code here
int main() {
ArrTest<int> ar(); //DOES THIS USE THE MOST VEXING PARSE?
return 0;
}
My first question is that is the concept of "most vexing parse" formally defined by the C++ standard. My second question is that does the statement ArrTest<int> ar();
uses most vexing parse. That is, which of the above two quoted comments is technically correct?
This also seem to suggest that MyObject object();
is most vexing parse.