C++ Most vexing parse when a number literal is the argument? [duplicate]
问题 This question already has an answer here : Why can in-class initializers only use = or {}? (1 answer) Closed last year . I was making a class that looked like this: struct InputHandler { std::vector<std::pair<int, int>> keyBindings( 256 ); }; It came up with an error, and I know this is because the compiler interprets this as a function instead of a constructor argument. But I was wondering is there anything ambiguous when I've passed a number literal in brackets such as in this case? I know