🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #2839

Re: using namespace std

#2839
From: Matt Austern
Date: Mon, 04 Dec 1995 22:16
26 lines
2282 bytes
In article <l8220qk4oos.fsf@neppari.cs.hut.fi> Lassi.Tuura@hut.fi (Lassi A. Tuura) writes:

> I see two possible paths emerging from the current situation:
>   - programmers put "using namespace std;" in their programs, which
>     will be *very* unfortunate; it will be hard to motivate them
>     not to do so, at least not until the next revision is made to the
>     standard and they have tons of clashes...

Even if programmers do put "using namespace std" in their programs,
that isn't necessary such a disaster.  Remember, you can put a
using-directive anywhere, not just at namespace scope.  So you can put
"using namespace std" in function definitions (and not necessarily all
function definitions), rather than at the beginning of every file.
That will ensure, at any rate, that any problems will be local ones.

I agree that it would be nice to have namespace std partitioned a bit
more finely; I doubt if it will happen, though.  Coming up with a
sensible partitioning might be a fair amount of work.
-- 
  Matt Austern                             He showed his lower teeth.  "We 
  matt@physics.berkeley.edu                all have flaws," he said, "and 
  http://dogbert.lbl.gov/~matt             mine is being wicked."

[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID: <MATT.95Dec4150307@cyclops5.berkeley.edu>
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamage
References: <LASSI.TUURA.95Nov22175004@neppari.cs.hut.fi> <30BA21AC.4E9C@netcom.com> <VANDEVOD.95Nov28152659@avs.cs.rpi.edu> <l8220qk4oos.fsf@neppari.cs.hut.fi>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamage
From: matt@cyclops5.berkeley.edu (Matt Austern)
Newsgroups: comp.std.c++
Subject: Re: using namespace std
Date: 4 Dec 1995 22:16:45 GMT
Organization: University of California at Berkeley (computational neuroscience)
Approved: clamage@eng.sun.com (comp.std.c++)
Message-ID: <MATT.95Dec4150307@cyclops5.berkeley.edu>
References: <LASSI.TUURA.95Nov22175004@neppari.cs.hut.fi> <30BA21AC.4E9C@netcom.com> <VANDEVOD.95Nov28152659@avs.cs.rpi.edu> <l8220qk4oos.fsf@neppari.cs.hut.fi>
Reply-To: matt@physics.berkeley.edu
NNTP-Posting-Host: taumet.eng.sun.com
Content-Type: text
X-Nntp-Posting-Host: cyclops5.berkeley.edu
In-Reply-To: Lassi.Tuura@hut.fi's message of 04 Dec 1995 22:32:42 GMT
Content-Length: 1235
X-Lines: 22
Originator: clamage@taumet