I have two code snippets:
This does not compile:
std::string reverseSentence(std::string sentence) {
std::stringstream stream = sentence;
}
This does:
std::stringstream stream (sentence);
It's my understanding that T foo = expr
is T foo(expr)
. Thus, aren't the two stringstream initializations equivalent? Why is one compiling and the other not?