This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project. See the Cygwin home page for more information.
Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: GNU and std namespaces


Paul Thiessen <paul@grserv.med.jhmi.edu> writes:
> Just a general curiosity question. I've been reading the C++ standard,
> which talks about the std namespace that's supposed to be used with
> standard library stuff with the new headers like <iostream>. But when I
> look at the headers that come with mingw32/egcs, I see that <iostream>
> just contains "#include <iostream.h>", and that <iostream.h> doesn't seem
> to have any mention of std namespace. Has this just not yet been
> implemented in GNU, or is there some more subtle mechanism used that's not
> apparent from a quick glance at the header files?

EGCS lacks a standard compliant C++ library implementation, so the
namespacing isn't strictly correct. However, EGCS will accept std::
(it's an internal hack, but at least that makes maintaining code 
across compilers much easier).

  #include <string>
  using namespace std;
  string s ("hello world");

or,

  #include <string>
  std::string s ("hello world");

Regards,
Mumit


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com