On 2003-09-22 09:23+0100 Andrew Ross wrote:
> On Sat, Sep 20, 2003 at 02:26:47PM -0500, Maurice LeBrun wrote:
> > Jo?o Cardoso writes:
> > > BTH, on my system, SuSE-8.2 with gcc-3.3, some c++ examples don't
> > > compile because of "endl" being undeclared. The fix is to use
> > > "std::endl" instead, or use "using namespace std;" after the include
> > > directives (and removing all "std::" from the file)
> > The way I like best for this situation is:
> > - generally put "using namespace std;" after the include directives
> > in the C++ source files (never in the header file). I hate having all
> > those std::endl's and such all over the place.
> > - in header files and function declarations, use explicit std:: namespace
> > declarations. In the former, it's necessary, and in the latter lets you
> > use the exact same arglist in the source file declaration as the header
> > file, good for avoiding errors.
> Yeah - sorry about the missing std:: . GCC 2.95 isn't that picky about
> it. I also realised I'd forgot to add any to example 21. Personally I'm
> happy to switch to using namespace std if people think that is neater.
> I've converted the examples and I'll send a patch to Alan.
I applied the patch, resolved the few minor conflicts. made sure it built
okay with gcc 2.9.5, and committed it. With those of you with access to gcc
3.x (which apparently is more sensitive to namespace issues) please give it
Alan W. Irwin
Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).
Programming affiliations with the PLplot scientific plotting software
package (plplot.org), the Yorick front-end to PLplot (yplot.sf.net), the
Loads of Linux Links project (loll.sf.net), and the Linux Brochure Project