J
jmichae3
std:stream o;
gives compile errors. says "protected" like all other iostreams in gcc now in 4.9.0. Looked at the error. so I guessed:
std:stream<char> o;
this didn't work either.
well, I saw an example using a std::filebuf at http://www.cplusplus.com/reference/ostream/ostream/ostream/
so, I used the example code using streambuf.
std::streambuf sbf;//this is protected! agh! http://www.cplusplus.com/reference/streambuf/basic_streambuf/basic_streambuf/
std::stringbuf sbf;//this is protected! agh! http://www.cplusplus.com/reference/sstream/basic_stringbuf/
and filebuf is probably (?) unusable, since I am not dealing with a file right now, I want it to work like std::cout for the time being.
f:\x86_64-4.9.0-snapshot-20140219-rev207854-win32-sjlj-rt_v4\mingw64\x86_64-w64-mingw32\include\c++\streambuf:463:7: error: 'std::ba
sic_streambuf<_CharT, _Traits>::basic_streambuf() [with _CharT = char; _Traits = std::char_traits<char>]' is protected
grep.cpp:21:16: error: within this context
compiling with c++ and using iostream has become impossible.
anyone with understanding on how to resolve this problem, please
do I have to start over from scratch and write my own compiler? ugh. not something I can do. streams are getting harder and harder to use. someone have a workaround?
just how am I supposed to use std:stream now with c++11?
gives compile errors. says "protected" like all other iostreams in gcc now in 4.9.0. Looked at the error. so I guessed:
std:stream<char> o;
this didn't work either.
well, I saw an example using a std::filebuf at http://www.cplusplus.com/reference/ostream/ostream/ostream/
so, I used the example code using streambuf.
std::streambuf sbf;//this is protected! agh! http://www.cplusplus.com/reference/streambuf/basic_streambuf/basic_streambuf/
std::stringbuf sbf;//this is protected! agh! http://www.cplusplus.com/reference/sstream/basic_stringbuf/
and filebuf is probably (?) unusable, since I am not dealing with a file right now, I want it to work like std::cout for the time being.
f:\x86_64-4.9.0-snapshot-20140219-rev207854-win32-sjlj-rt_v4\mingw64\x86_64-w64-mingw32\include\c++\streambuf:463:7: error: 'std::ba
sic_streambuf<_CharT, _Traits>::basic_streambuf() [with _CharT = char; _Traits = std::char_traits<char>]' is protected
grep.cpp:21:16: error: within this context
compiling with c++ and using iostream has become impossible.
anyone with understanding on how to resolve this problem, please
do I have to start over from scratch and write my own compiler? ugh. not something I can do. streams are getting harder and harder to use. someone have a workaround?
just how am I supposed to use std:stream now with c++11?