🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Wil Evers on Thu Aug 24 1995 926... Thu, 24 Aug 1995 15:43
Re: C++ Standard Libraries?
#1836
Author: Wil Evers on Thu Aug 24 1995 926...
Date: Thu, 24 Aug 1995 15:43
33 lines
1997 bytes
This message was sent using a custom form that is not installed on your server.
Some information from the original message may not be displayed. To view the
complete message, ask your network manager to install the form on your server.

In article <41d26q$4vv@engnews2.Eng.Sun.COM>, stephen.clamage@eng.sun.com (Steve
Clamage) wrote:

> Thus, in portable code, you will be able to write for example
> 	#include <iostream>
> and you get the iostream declarations as required by the standard,
> no matter what the implementation provides as files or how it
> spells the file names.
> 
> In addition, an implementation may allow other header spellings to
> mean the same thing. If an implementation previously used
> <iostream.hpp>, it could continue to allow that as a synonym for
> <iostream>. Existing code continues to work unchanged, and standard-
> conforming code also works correctly. I would expect all
> implementations to continue to support their original header spellings
> where they do not conflict with other requirements.

Here's a stupid newbie question about using the standard library C++ headers:
Does this mean I would still have to write `using namespace std' after the
`#include <iostream>', or is such a statement in the header itself? If so, how
can I include this header without importing its symbols directly into the
program?

- Wil Evers (wil@ittpub.nl)


[ 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. ]
Re: C++ Standard Libraries?
#1841
Author: Steve Clamage
Date: Thu, 24 Aug 1995 21:52
44 lines
2411 bytes
Distribution:
In article 72a@engnews2.Eng.Sun.COM, Wil Evers on Thu, Aug 24, 1995 9:26 AM writes:
>In article <41d26q$4vv@engnews2.Eng.Sun.COM>, stephen.clamage@eng.sun.com (Steve
>Clamage) wrote:
>
>> Thus, in portable code, you will be able to write for example
>> 	#include <iostream>
>> and you get the iostream declarations as required by the standard,
>> no matter what the implementation provides as files or how it
>> spells the file names.
>> 
>
>Here's a stupid newbie question about using the standard library C++ headers:
>Does this mean I would still have to write `using namespace std' after the
>`#include <iostream>', or is such a statement in the header itself? If so, how
>can I include this header without importing its symbols directly into the
>program?

Not a stupid question at all, but one the committee has been wrestling with.

If you use something like "#include <iostream>" (no suffix on the header
name), you will get the iostream declarations in namespace "std".

You can add your own "using namespace std;" if you want, which will bring
the entire contents of the "std" namespace into scope (but just for those
headers which you include).

Implementations will be likely also to provide compatibility headers (perhaps
e.g. <iostream.h>) which will include <iostream> followed by using-declarations
for each item in the header. That will allow existing code to compile if they
include the compatibility header. One early draft of the standard called out
headers like those explicitly, but they have since been removed from the draft.
(There still exist two versions of the C library headers, as I discussed
in the original article.)

---
Steve Clamage, stephen.clamage@eng.sun.com



---
[ 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. ]
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads