c++11 - C++ compiler does not recognize std::stringstream::swap -
c++11 - C++ compiler does not recognize std::stringstream::swap -
i trying compile next code g++ (gcc) 4.8.2 20131212 (red hat 4.8.2-7):
#include <sstream> using namespace std; int main(int argc, char ** argv) { auto x = 1; stringstream s1, s2; s1.swap(s2); } i next error:
g++ -g -std=c++0x -c main.cpp main.cpp: in function ‘int main(int, char**)’: main.cpp:8:5: error: ‘std::stringstream’ has no fellow member named ‘swap’ s1.swap(s2); ^ make: *** [main.o] error 1 according this reference should work. using different -std flags (gnu++11, c++0x etc.) didn't help. missing?
from gcc implementation status:
section: 27.5 description: iostreams base of operations classes support: partial comments:
missingmove , swap operations on basic_ios. missing io_errc , iostream_category. ios_base::failure not derived system_error. missing ios_base::hexfloat. more info here
c++ c++11 g++4.8
Comments
Post a Comment