S
Siemel Naran
My compiler (Borland C++) fails to compile this code:
ifstream file(filename.c_str());
ostringstream out;
file >> out.rdbuf();
with the error in the 3rd line above that:
[C++ Error] realmain.cpp(83): E2015 Ambiguity between
'_STL::basic_istream<char,_STL::char_traits<char> >:perator >>(bool &)'
and '_STL::basic_istream<char,_STL::char_traits<char> >:perator >>(void *
&)'
But it compiles the following without error.
ifstream file(filename.c_str());
ostringstream out;
streambuf * outbuf = out.rdbuf();
file >> outbuf;
Why the discrepancy?
ifstream file(filename.c_str());
ostringstream out;
file >> out.rdbuf();
with the error in the 3rd line above that:
[C++ Error] realmain.cpp(83): E2015 Ambiguity between
'_STL::basic_istream<char,_STL::char_traits<char> >:perator >>(bool &)'
and '_STL::basic_istream<char,_STL::char_traits<char> >:perator >>(void *
&)'
But it compiles the following without error.
ifstream file(filename.c_str());
ostringstream out;
streambuf * outbuf = out.rdbuf();
file >> outbuf;
Why the discrepancy?