Red Hat Bugzilla – Bug 75287
<ostream> vs <ostream.h>
Last modified: 2007-04-18 12:47:15 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2b) Gecko/20021002
Description of problem:
The following file compiles:
ostream& operator<< (ostream&, int);
but gives the warning:
In file included from /usr/include/c++/3.2/backward/ostream.h:31,
/usr/include/c++/3.2/backward/backward_warning.h:32:2: warning: #warning This
file includes at least one deprecated or antiquated header. Please consider
using one of the 32 headers found in section 22.214.171.124 of the C++ standard.
Examples include substituting the <X> header for the <X.h> header for C++
includes, or <sstream> instead of the deprecated header <strstream.h>. To
disable this warning use -Wno-deprecated.
If I change <ostream.h> to <ostream> however, I get:
try.C:3: syntax error before `&' token
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.c++ -c file.C with above files
Actual Results: See above
Expected Results: Should compile ?
The compiler is right, your program is not ISO C++.
std::ostream& operator<< (std::ostream&, int);
Or you could add
using namespace std;
after your includes.
Wow, that was quick. Thanks.
I see now that converting my entire tree to new style headers
is going to involve more than just a few streamedits.