From: Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de>
To: egcs@cygnus.com
Subject: namespace std in libstdc++
Date: Sat, 09 May 1998 03:34:00 -0000 [thread overview]
Message-ID: <199805090839.KAA19178@mira.isdn.cs.tu-berlin.de> (raw)
This patch adds 'namespace std' to several places in libstdc++. It is
only a minimal change:
- std is enabled for STL, which already provides this as a configuration
option.
- std is added to stdexcept, like the exceptions used by the language
runtime (e.g. std::bad_alloc).
- std qualification is added to places where it was missing.
With current egcs, these changes are not noticable unless g++ is
invoked with -fnew-abi. As this option suggests, enabling it really
results in binary incompatibility, as the mangling for std:: qualified
types will be different.
I'm aware that std scoping is missing in many more places, but I hope
that will be provided in the upcoming rewrite of libstdc++.
Martin
Sat May 9 09:32:20 1998 Martin von Loewis <loewis@informatik.hu-berlin.de>
* stdexcept: Conditionally wrap into namespace std.
* stl/stl_config.h: Likewise, for gcc 2.8 or better.
* stdexcepti.cc (__out_of_range, __length_error): Qualify standard
exception classes with std::.
* bastring.h: Qualify iterator templates with std::.
Index: stdexcept
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/libstdc++/stdexcept,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 stdexcept
--- stdexcept 1997/08/21 22:58:34 1.1.1.1
+++ stdexcept 1998/05/09 07:45:21
@@ -37,6 +37,10 @@
extern "C++" {
+#ifdef __HONOR_STD
+namespace std {
+#endif
+
class logic_error : public exception {
string _what;
public:
@@ -87,6 +91,10 @@ class underflow_error : public runtime_e
public:
underflow_error (const string& what_arg): runtime_error (what_arg) { }
};
+
+#ifdef __HONOR_STD
+} // namespace std
+#endif
} // extern "C++"
Index: stdexcepti.cc
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/libstdc++/stdexcepti.cc,v
retrieving revision 1.2
diff -u -p -r1.2 stdexcepti.cc
--- stdexcepti.cc 1997/10/10 06:56:52 1.2
+++ stdexcepti.cc 1998/05/09 07:45:21
@@ -12,10 +12,10 @@
void
__out_of_range (const char *s)
{
- throw out_of_range (s);
+ throw std::out_of_range (s);
}
void __length_error (const char *s)
{
- throw length_error (s);
+ throw std::length_error (s);
}
Index: std/bastring.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/libstdc++/std/bastring.h,v
retrieving revision 1.11
diff -u -p -r1.11 bastring.h
--- bastring.h 1998/01/25 16:45:02 1.11
+++ bastring.h 1998/05/09 07:45:21
@@ -105,8 +105,8 @@ public:
typedef const charT* const_pointer;
typedef pointer iterator;
typedef const_pointer const_iterator;
- typedef ::reverse_iterator<iterator> reverse_iterator;
- typedef ::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
static const size_type npos = static_cast<size_type>(-1);
private:
Index: stl/stl_config.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/libstdc++/stl/stl_config.h,v
retrieving revision 1.5
diff -u -p -r1.5 stl_config.h
--- stl_config.h 1998/02/20 11:13:42 1.5
+++ stl_config.h 1998/05/09 07:45:22
@@ -113,6 +113,9 @@
# define __STL_FUNCTION_TMPL_PARTIAL_ORDER
# define __STL_EXPLICIT_FUNCTION_TMPL_ARGS
# define __STL_MEMBER_TEMPLATES
+# if defined(__HONOR_STD)
+# define __STL_USE_NAMESPACES
+# endif
# endif
# if !defined(_NOTHREADS) && __GLIBC__ >= 2
# define __STL_PTHREADS
reply other threads:[~1998-05-09 3:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199805090839.KAA19178@mira.isdn.cs.tu-berlin.de \
--to=martin@mira.isdn.cs.tu-berlin.de \
--cc=egcs@cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).