An assignment like the following
std::stringstream strstr;
strstr = std::stringstream(someString)
does give me an error when compiling in gcc:
error: use of deleted function ‘std::basic_stringstream<char>& std::basic_stringstream<char>::operator=(const std::basic_stringstream<char>&)’
Now, I know that streams apparently cannot be copied and the copy constructor of std::stringstream
is marked as deleted. However, to my understanding the aforementioned should be a move assignment, not a copy assignment since there is an r-value on the right side of the assignment operator.
Althogh in this case it could probably solve by just using strstr.str(someString)
instead, I still would be interested in what causes this compiler error. It compiles without problems in VC++ by the way.
This was delayed for reasons of ABI compatibilty. They wanted to wait for a major version number change. It is there in the recently released version 5.1: https://gcc.gnu.org/gcc-5/changes.html#libstdcxx
- movable and swappable iostream classes;