c++ - Std::stringstream move assignment not working in gcc -


an assignment following

std::stringstream strstr; strstr = std::stringstream(somestring) 

does give me 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, know streams apparently cannot copied , copy constructor of std::stringstream marked deleted. however, understanding aforementioned should move assignment, not copy assignment since there r-value on right side of assignment operator.

althogh in case solve using strstr.str(somestring) instead, still interested in causes compiler error. compiles without problems in vc++ way.

this delayed reasons of abi compatibilty. wanted wait major version number change. there in released version 5.1: https://gcc.gnu.org/gcc-5/changes.html#libstdcxx

  • movable , swappable iostream classes;

Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -