Article View: comp.std.c++
Article #2193Re: Lumping ::std & Monterey (was: STL <iostream> vs. <iostream
From: Sean A Corfield
Date: Sat, 14 Oct 1995 15:57
Date: Sat, 14 Oct 1995 15:57
31 lines
1922 bytes
1922 bytes
In article <VANDEVOD.95Oct13185849@avs.cs.rpi.edu>,
vandevod@cs.rpi.edu (David Vandevoorde) wrote:
|> Vaguely related: say I want to pull everything that has to do with
|> valarrays (more precisely: all the classes and functions described
|> (in 26.3)) in my program, but I'd rather not pull in all of ::std.
|> (And I don't want to issue dozens of `using's either.)
At one point the Library WG considered multiple nested namespaces for this
purpose. They backed off, I think because of problems with operator lookup
(amongst others). Now that the operator lookup is 'fixed' it would probably
be a good idea to revisit the partitioning of the library.
In answer to your question, you could synthesise your own namespaces
containing just those elements you wanted but it would be somewhat
laborious:
namespace std_valarray {
using std::valarray;
using std::...
// etc etc etc
}
Then the std_valarray namespace would provide what you want.
[ 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:
<ACA53AEF96684C897@corf.demon.co.uk>Path:
arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamageReferences:
<45as8l$mf8@rational.rational.com> <45cp5c$sd@oznet03.ozemail.com.au> <45jbct$qv9@rational.rational.com> <u9ag75e27b.fsf@yorick.cygnus.com> <VANDEVOD.95Oct13185849@avs.cs.rpi.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamage From: Sean A Corfield <sean@corf.demon.co.uk> Newsgroups: comp.std.c++ Subject: Re: Lumping ::std & Monterey (was: STL <iostream> vs. <iostream Date: 14 Oct 1995 15:57:35 GMT Organization: OCS Approved: clamage@eng.sun.com (comp.std.c++) Message-ID: <ACA53AEF96684C897@corf.demon.co.uk> References: <45as8l$mf8@rational.rational.com> <45cp5c$sd@oznet03.ozemail.com.au> <45jbct$qv9@rational.rational.com> <u9ag75e27b.fsf@yorick.cygnus.com> <VANDEVOD.95Oct13185849@avs.cs.rpi.edu> NNTP-Posting-Host: taumet.eng.sun.com Content-Type: text X-Nntp-Posting-Host: corf.demon.co.uk X-Nntp-Posting-Host: corf.demon.co.uk Content-Length: 954 Originator: clamage@taumet