In the code snippet below, if I exclude the brackets around the second call std::istreambuf_iterator, I get a compilation error in the last line:
to the left of .c_str () should have a class / struct / union.
std::ifstream file("file.txt");;
std::string prog(
std::istreambuf_iterator<char>(file),
(std::istreambuf_iterator<char>()));
prog.c_str();
What do these parentheses do? It seems to me that they should be excluded.
user220878
source
share