Ed Sweetman writes:
> Ed Sweetman wrote:
>> namespace declarations do not go in header files. Period. I thought they
>> taught that in intro C++ courses. It causes namespace pollution. I'm
>> reverting all namespace additions to headerfiles, compiling ...seeing if
>> that happens to work now since it wont compile as it is, then adding the
>> namespace std lines in the appropriate places in the source files and
>> testing that.
> Give me a few more hours.. I should have the entire unix/shared source
> tree converted to the way stl is supposed to be used. I'll be touching
> just about every file so i'll probably have to commit the changes in
This is very good news. Although I haven't had a chance to look at Zinf
sources lately, I recall that I was able to get the last public release of
Zinf compiled with gcc 3.2, although it spit out a bucketful of warnings,
due to namespace issues.
Converting pre-ISO/C++ code to the new STL and ISO/C++ namespacing is
certainly a painful experience. I've gone through it myself with several
large chunks of code. My general approach usually goes something like this:
* Fix all the includes: iostream.h >iostream, etc... Nothing will compile
* Throw 'using namespace std' everywhere, into whichever files it needs to
go in order to get everything compiled again. Into header files, into C
files. Whatever. Throw it wherever you need to throw in order to get
everything compiled again. Fix stringstream -> strstream mess.
* Once everything compiles, and you verified that the code actually works,
start fixing all the headers, one by one. Remove 'using namespace std' one
by one, recompile, see what breaks, fix it. Lather, rinse, repeat.
Wish I could help here, but I got my own fires to put out. I'll lend some
moral support instead. Zinf will be better for it.
If you have the time, make sure everything gets compiled with -Wall, and no
warning. A lot of crap will fall out when -Wall is used for the first time.