In order to avoid the Most Vexing Parse I added extra parentheses here:
std::vector<int> v(std::istream_iterator<int>(inp), (std::istream_iterator<int>()));
Where inp
is an istringstream
created from a std::string
.
But why do the extra parentheses work? Why doesn't the compiler ignore them as redundant?