Clean up stdexcept.
2001-02-07 Benjamin Kosnik <bkoz@redhat.com> Clean up stdexcept. * include/bits/stringfwd.h: New file. * include/bits/stl_string_fwd.h: Remove. * include/bits/localefwd.h: Remove declaration for allocator. * include/bits/std_iosfwd: Same. * include/bits/std_string.h: Include it. * include/bits/std_ios.h: Remove include. * include/bits/basic_string.h: Tweak. * libsupc++/new: Format. * src/Makefile.am (base_headers): Add stringfwd.h, remove stl_string_fwd.h * src/Makefile.in: Regenerate. * include/bits/std_stdexcept.h: Rewrite. * src/stdexcept.cc: Same. From-SVN: r39526
This commit is contained in:
parent
830a95f892
commit
0c952af328
@ -1,3 +1,20 @@
|
||||
2001-02-07 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
Clean up stdexcept.
|
||||
* include/bits/stringfwd.h: New file.
|
||||
* include/bits/stl_string_fwd.h: Remove.
|
||||
* include/bits/localefwd.h: Remove declaration for allocator.
|
||||
* include/bits/std_iosfwd: Same.
|
||||
* include/bits/std_string.h: Include it.
|
||||
* include/bits/std_ios.h: Remove include.
|
||||
* include/bits/basic_string.h: Tweak.
|
||||
* libsupc++/new: Format.
|
||||
* src/Makefile.am (base_headers): Add stringfwd.h, remove
|
||||
stl_string_fwd.h
|
||||
* src/Makefile.in: Regenerate.
|
||||
* include/bits/std_stdexcept.h: Rewrite.
|
||||
* src/stdexcept.cc: Same.
|
||||
|
||||
2001-02-06 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
* acinclude.m4 (GLIBCPP_EXPORT_INSTALL_INFO): Deal with library
|
||||
|
@ -1028,7 +1028,6 @@ namespace std {
|
||||
inline basic_istream<_CharT,_Traits>&
|
||||
getline(basic_istream<_CharT, _Traits>& __is,
|
||||
basic_string<_CharT, _Traits, _Alloc>& __str);
|
||||
|
||||
} // namespace std
|
||||
|
||||
#endif /* _CPP_BITS_STRING_H */
|
||||
|
@ -79,8 +79,8 @@ namespace std
|
||||
};
|
||||
|
||||
// 22.1.1 Locale
|
||||
template<typename _Tp> class allocator;
|
||||
template<typename _Tp, typename _Alloc> class vector;
|
||||
template<typename _Tp, typename _Alloc>
|
||||
class vector;
|
||||
class locale;
|
||||
|
||||
// 22.1.3 Convenience interfaces
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Iostreams base classes -*- C++ -*-
|
||||
|
||||
// Copyright (C) 1997-1999 Free Software Foundation, Inc.
|
||||
// Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
@ -37,7 +37,6 @@
|
||||
#include <bits/std_iosfwd.h>
|
||||
#include <exception> // For ios_base::failure
|
||||
#include <bits/char_traits.h> // For char_traits, streamoff, streamsize, fpos
|
||||
#include <bits/stl_string_fwd.h>// For string.
|
||||
#include <bits/std_cstdio.h> // For SEEK_SET, SEEK_CUR, SEEK_END
|
||||
#include <bits/localefwd.h> // For class locale
|
||||
#include <bits/ios_base.h> // For ios_base declarations.
|
||||
|
@ -36,13 +36,10 @@
|
||||
|
||||
#include <bits/c++config.h>
|
||||
#include <bits/std_cwchar.h> // For mbstate_t
|
||||
#include <bits/stringfwd.h> // For string forward declarations.
|
||||
|
||||
namespace std {
|
||||
|
||||
// Generic declarations.
|
||||
template<typename _CharT> struct char_traits;
|
||||
template<typename _Alloc> class allocator;
|
||||
|
||||
namespace std
|
||||
{
|
||||
// Forward declarations
|
||||
template<> class char_traits<char>;
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
@ -50,53 +47,53 @@ namespace std {
|
||||
#endif
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT> >
|
||||
class basic_ios;
|
||||
class basic_ios;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT> >
|
||||
class basic_streambuf;
|
||||
class basic_streambuf;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT> >
|
||||
class basic_istream;
|
||||
class basic_istream;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT> >
|
||||
class basic_ostream;
|
||||
class basic_ostream;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT> >
|
||||
class basic_iostream;
|
||||
class basic_iostream;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT>,
|
||||
typename _Alloc = allocator<_CharT> >
|
||||
class basic_stringbuf;
|
||||
class basic_stringbuf;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT>,
|
||||
typename _Alloc = allocator<_CharT> >
|
||||
class basic_istringstream;
|
||||
class basic_istringstream;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT>,
|
||||
typename _Alloc = allocator<_CharT> >
|
||||
class basic_ostringstream;
|
||||
class basic_ostringstream;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT>,
|
||||
typename _Alloc = allocator<_CharT> >
|
||||
class basic_stringstream;
|
||||
class basic_stringstream;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT> >
|
||||
class basic_filebuf;
|
||||
class basic_filebuf;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT> >
|
||||
class basic_ifstream;
|
||||
class basic_ifstream;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT> >
|
||||
class basic_ofstream;
|
||||
class basic_ofstream;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT> >
|
||||
class basic_fstream;
|
||||
class basic_fstream;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT> >
|
||||
class istreambuf_iterator;
|
||||
class istreambuf_iterator;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT> >
|
||||
class ostreambuf_iterator;
|
||||
class ostreambuf_iterator;
|
||||
|
||||
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
|
||||
// Not included.
|
||||
@ -144,14 +141,6 @@ namespace std {
|
||||
typedef basic_ofstream<wchar_t> wofstream;
|
||||
typedef basic_fstream<wchar_t> wfstream;
|
||||
#endif
|
||||
|
||||
} // namespace std
|
||||
|
||||
#endif // _CPP_IOSFWD
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,90 +1,115 @@
|
||||
/*
|
||||
* Copyright (c) 1997
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Silicon Graphics makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
// Standard exception classes -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
//
|
||||
// ISO C++ 19.1 Exception classes
|
||||
//
|
||||
|
||||
#ifndef _CPP_STDEXCEPT
|
||||
#define _CPP_STDEXCEPT 1
|
||||
#define _CPP_STDEXCEPT 1
|
||||
|
||||
#include <exception>
|
||||
#include <bits/stringfwd.h>
|
||||
|
||||
#if defined(__STL_USE_EXCEPTIONS) || \
|
||||
!(defined(_MIPS_SIM) && defined(_ABIO32) && _MIPS_SIM == _ABIO32)
|
||||
namespace std
|
||||
{
|
||||
class logic_error : public exception
|
||||
{
|
||||
const string& _M_msg;
|
||||
|
||||
#include <bits/stl_string_fwd.h>
|
||||
public:
|
||||
explicit
|
||||
logic_error(const string& __arg);
|
||||
|
||||
__STL_BEGIN_NAMESPACE
|
||||
virtual
|
||||
~logic_error() throw();
|
||||
|
||||
class __Named_exception : public exception {
|
||||
public:
|
||||
__Named_exception(const string& __str);
|
||||
virtual const char* what() const __STL_NOTHROW { return _M_name; }
|
||||
virtual const char*
|
||||
what() const throw();
|
||||
};
|
||||
|
||||
private:
|
||||
enum { _S_bufsize = 256 };
|
||||
char _M_name[_S_bufsize];
|
||||
};
|
||||
class domain_error : public logic_error
|
||||
{
|
||||
public:
|
||||
explicit domain_error(const string& __arg);
|
||||
};
|
||||
|
||||
class logic_error : public __Named_exception {
|
||||
public:
|
||||
logic_error(const string& __s) : __Named_exception(__s) {}
|
||||
};
|
||||
class invalid_argument : public logic_error
|
||||
{
|
||||
public:
|
||||
explicit invalid_argument(const string& __arg);
|
||||
};
|
||||
|
||||
class runtime_error : public __Named_exception {
|
||||
public:
|
||||
runtime_error(const string& __s) : __Named_exception(__s) {}
|
||||
};
|
||||
class length_error : public logic_error
|
||||
{
|
||||
public:
|
||||
explicit length_error(const string& __arg);
|
||||
};
|
||||
|
||||
class domain_error : public logic_error {
|
||||
public:
|
||||
domain_error(const string& __arg) : logic_error(__arg) {}
|
||||
};
|
||||
class out_of_range : public logic_error
|
||||
{
|
||||
public:
|
||||
explicit out_of_range(const string& __arg);
|
||||
};
|
||||
|
||||
class invalid_argument : public logic_error {
|
||||
public:
|
||||
invalid_argument(const string& __arg) : logic_error(__arg) {}
|
||||
};
|
||||
class runtime_error : public exception
|
||||
{
|
||||
const string& _M_msg;
|
||||
|
||||
class length_error : public logic_error {
|
||||
public:
|
||||
length_error(const string& __arg) : logic_error(__arg) {}
|
||||
};
|
||||
public:
|
||||
explicit
|
||||
runtime_error(const string& __arg);
|
||||
|
||||
class out_of_range : public logic_error {
|
||||
public:
|
||||
out_of_range(const string& __arg) : logic_error(__arg) {}
|
||||
};
|
||||
virtual
|
||||
~runtime_error() throw();
|
||||
|
||||
class range_error : public runtime_error {
|
||||
public:
|
||||
range_error(const string& __arg) : runtime_error(__arg) {}
|
||||
};
|
||||
virtual const char*
|
||||
what() const throw();
|
||||
};
|
||||
|
||||
class overflow_error : public runtime_error {
|
||||
public:
|
||||
overflow_error(const string& __arg) : runtime_error(__arg) {}
|
||||
};
|
||||
class range_error : public runtime_error
|
||||
{
|
||||
public:
|
||||
explicit range_error(const string& __arg);
|
||||
};
|
||||
|
||||
class underflow_error : public runtime_error {
|
||||
public:
|
||||
underflow_error(const string& __arg) : runtime_error(__arg) {}
|
||||
};
|
||||
class overflow_error : public runtime_error
|
||||
{
|
||||
public:
|
||||
explicit overflow_error(const string& __arg);
|
||||
};
|
||||
|
||||
__STL_END_NAMESPACE
|
||||
|
||||
#endif /* Not o32, and no exceptions */
|
||||
|
||||
#endif /* _CPP_STDEXCEPT */
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
class underflow_error : public runtime_error
|
||||
{
|
||||
public:
|
||||
explicit underflow_error(const string& __arg);
|
||||
};
|
||||
} // namespace std
|
||||
|
||||
#endif // _CPP_STDEXCEPT
|
||||
|
@ -35,11 +35,12 @@
|
||||
#define _CPP_STRING 1
|
||||
|
||||
#include <bits/c++config.h>
|
||||
#include <bits/stl_string_fwd.h>
|
||||
#include <bits/std_iterator.h>
|
||||
#include <bits/stringfwd.h>
|
||||
#include <bits/char_traits.h>
|
||||
#include <bits/std_iterator.h>
|
||||
#include <bits/std_memory.h> // For allocator.
|
||||
#include <bits/type_traits.h>
|
||||
#include <bits/std_iosfwd.h> // for operators >>, <<, and getline decls
|
||||
#include <bits/std_iosfwd.h> // For operators >>, <<, and getline decls.
|
||||
#include <bits/basic_string.h>
|
||||
|
||||
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
|
||||
|
@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997
|
||||
* Silicon Graphics Computer Systems, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and
|
||||
* that both that copyright notice and this permission notice appear
|
||||
* in supporting documentation. Silicon Graphics makes no
|
||||
* representations about the suitability of this software for any
|
||||
* purpose. It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
|
||||
#ifndef __SGI_STL_STRING_FWD_H
|
||||
#define __SGI_STL_STRING_FWD_H
|
||||
|
||||
#include <bits/stl_config.h>
|
||||
#include <bits/stl_alloc.h>
|
||||
#include <bits/char_traits.h>
|
||||
|
||||
__STL_BEGIN_NAMESPACE
|
||||
|
||||
template <class _CharT,
|
||||
class _Traits = char_traits<_CharT>,
|
||||
class _Alloc = allocator<_CharT> >
|
||||
class basic_string;
|
||||
|
||||
typedef basic_string<char> string;
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
typedef basic_string<wchar_t> wstring;
|
||||
#endif
|
||||
|
||||
__STL_END_NAMESPACE
|
||||
|
||||
#endif /* __SGI_STL_STRING_FWD_H */
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
61
libstdc++-v3/include/bits/stringfwd.h
Normal file
61
libstdc++-v3/include/bits/stringfwd.h
Normal file
@ -0,0 +1,61 @@
|
||||
// String support -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
//
|
||||
// ISO C++ 14882: 21 Strings library
|
||||
//
|
||||
|
||||
#ifndef _CPP_BITS_STRINGFWD_H
|
||||
#define _CPP_BITS_STRINGFWD_H 1
|
||||
|
||||
#include <bits/c++config.h>
|
||||
|
||||
namespace std
|
||||
{
|
||||
template<class _CharT>
|
||||
struct char_traits;
|
||||
|
||||
template<typename _Alloc>
|
||||
class allocator;
|
||||
|
||||
template<typename _CharT, typename _Traits = char_traits<_CharT>,
|
||||
typename _Alloc = allocator<_CharT> >
|
||||
class basic_string;
|
||||
|
||||
typedef basic_string<char> string;
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
typedef basic_string<wchar_t> wstring;
|
||||
#endif
|
||||
} // namespace std
|
||||
|
||||
#endif // _CPP_BITS_STRINGFWD_H
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
@ -1,5 +1,6 @@
|
||||
// The -*- C++ -*- dynamic memory management header.
|
||||
// Copyright (C) 1994, 1996, 1997, 1998, 2000 Free Software Foundation
|
||||
|
||||
// Copyright (C) 1994, 1996, 1997, 1998, 2000, 2001 Free Software Foundation
|
||||
|
||||
// This file is part of GNU CC.
|
||||
//
|
||||
@ -36,31 +37,31 @@
|
||||
|
||||
extern "C++" {
|
||||
|
||||
namespace std {
|
||||
|
||||
class bad_alloc : public exception {
|
||||
namespace std
|
||||
{
|
||||
class bad_alloc : public exception
|
||||
{
|
||||
public:
|
||||
virtual const char* what() const throw() { return "bad_alloc"; }
|
||||
};
|
||||
|
||||
struct nothrow_t {};
|
||||
struct nothrow_t { };
|
||||
extern const nothrow_t nothrow;
|
||||
typedef void (*new_handler)();
|
||||
new_handler set_new_handler (new_handler);
|
||||
|
||||
new_handler set_new_handler(new_handler);
|
||||
} // namespace std
|
||||
|
||||
// replaceable signatures
|
||||
void *operator new (std::size_t) throw (std::bad_alloc);
|
||||
void *operator new[] (std::size_t) throw (std::bad_alloc);
|
||||
void operator delete (void *) throw();
|
||||
void operator delete[] (void *) throw();
|
||||
void *operator new (std::size_t, const std::nothrow_t&) throw();
|
||||
void *operator new[] (std::size_t, const std::nothrow_t&) throw();
|
||||
void operator delete (void *, const std::nothrow_t&) throw();
|
||||
void operator delete[] (void *, const std::nothrow_t&) throw();
|
||||
// Replaceable signatures.
|
||||
void *operator new(std::size_t) throw (std::bad_alloc);
|
||||
void *operator new[](std::size_t) throw (std::bad_alloc);
|
||||
void operator delete(void *) throw();
|
||||
void operator delete[](void *) throw();
|
||||
void *operator new(std::size_t, const std::nothrow_t&) throw();
|
||||
void *operator new[](std::size_t, const std::nothrow_t&) throw();
|
||||
void operator delete(void *, const std::nothrow_t&) throw();
|
||||
void operator delete[](void *, const std::nothrow_t&) throw();
|
||||
|
||||
// default placement versions of operator new
|
||||
// Default placement versions of operator new.
|
||||
inline void *operator new(std::size_t, void *place) throw() { return place; }
|
||||
inline void *operator new[](std::size_t, void *place) throw() { return place; }
|
||||
} // extern "C++"
|
||||
|
@ -21,7 +21,7 @@
|
||||
## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
## USA.
|
||||
|
||||
## $Id: Makefile.am,v 1.69 2001/02/06 06:36:18 mmitchel Exp $
|
||||
## $Id: Makefile.am,v 1.70 2001/02/07 01:54:21 bkoz Exp $
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.3 gnits
|
||||
MAINT_CHARSET = latin1
|
||||
@ -66,7 +66,8 @@ INCLUDES = \
|
||||
|
||||
base_headers = \
|
||||
bits/cpp_type_traits.h bits/char_traits.h bits/codecvt.h \
|
||||
bits/std_string.h bits/basic_string.h bits/basic_string.tcc \
|
||||
bits/stringfwd.h bits/std_string.h bits/basic_string.h \
|
||||
bits/basic_string.tcc \
|
||||
bits/generic_shadow.h bits/std_utility.h \
|
||||
bits/std_complex.h \
|
||||
bits/valarray_array.h bits/valarray_array.tcc bits/valarray_meta.h \
|
||||
@ -94,7 +95,7 @@ base_headers = \
|
||||
bits/stl_multimap.h bits/stl_multiset.h bits/stl_numeric.h \
|
||||
bits/stl_pair.h bits/stl_queue.h bits/stl_raw_storage_iter.h \
|
||||
bits/stl_relops.h bits/stl_set.h \
|
||||
bits/stl_stack.h bits/stl_string_fwd.h bits/stl_tempbuf.h \
|
||||
bits/stl_stack.h bits/stl_tempbuf.h \
|
||||
bits/stl_tree.h bits/stl_uninitialized.h bits/stl_vector.h \
|
||||
bits/type_traits.h bits/stl_range_errors.h bits/std_algorithm.h \
|
||||
bits/concept_checks.h bits/container_concepts.h \
|
||||
|
@ -144,7 +144,7 @@ TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
|
||||
INCLUDES = -nostdinc++ -I$(GLIBCPP_INCLUDE_DIR) $(CSTD_INCLUDES) -I$(top_builddir)/include $(LIBSUPCXX_INCLUDES) $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) $(TOPLEVEL_INCLUDES)
|
||||
|
||||
|
||||
base_headers = bits/cpp_type_traits.h bits/char_traits.h bits/codecvt.h bits/std_string.h bits/basic_string.h bits/basic_string.tcc bits/generic_shadow.h bits/std_utility.h bits/std_complex.h bits/valarray_array.h bits/valarray_array.tcc bits/valarray_meta.h bits/std_valarray.h bits/mask_array.h bits/slice.h bits/slice_array.h bits/gslice.h bits/gslice_array.h bits/indirect_array.h bits/exception_support.h bits/std_fstream.h bits/std_iomanip.h bits/ios_base.h bits/fpos.h bits/basic_ios.h bits/basic_ios.tcc bits/std_ios.h bits/std_iosfwd.h bits/std_iostream.h bits/std_istream.h bits/istream.tcc bits/std_locale.h bits/fstream.tcc bits/ostream.tcc bits/sbuf_iter.h bits/sstream.tcc bits/std_ostream.h bits/std_sstream.h bits/std_streambuf.h bits/streambuf.tcc bits/basic_file.h bits/locale_facets.h bits/locale_facets.tcc bits/localefwd.h bits/stl_pthread_alloc.h bits/pthread_allocimpl.h bits/stl_threads.h bits/stl_iterator_base.h bits/std_bitset.h bits/std_deque.h bits/std_functional.h bits/std_iterator.h bits/std_list.h bits/std_map.h bits/std_memory.h bits/std_numeric.h bits/std_queue.h bits/std_set.h bits/std_stack.h bits/std_stdexcept.h bits/std_vector.h bits/stl_algo.h bits/stl_algobase.h bits/stl_alloc.h bits/stl_deque.h bits/stl_function.h bits/stl_heap.h bits/stl_iterator.h bits/stl_list.h bits/stl_map.h bits/stl_multimap.h bits/stl_multiset.h bits/stl_numeric.h bits/stl_pair.h bits/stl_queue.h bits/stl_raw_storage_iter.h bits/stl_relops.h bits/stl_set.h bits/stl_stack.h bits/stl_string_fwd.h bits/stl_tempbuf.h bits/stl_tree.h bits/stl_uninitialized.h bits/stl_vector.h bits/type_traits.h bits/stl_range_errors.h bits/std_algorithm.h bits/concept_checks.h bits/container_concepts.h bits/sequence_concepts.h bits/stl_config.h bits/stl_construct.h
|
||||
base_headers = bits/cpp_type_traits.h bits/char_traits.h bits/codecvt.h bits/stringfwd.h bits/std_string.h bits/basic_string.h bits/basic_string.tcc bits/generic_shadow.h bits/std_utility.h bits/std_complex.h bits/valarray_array.h bits/valarray_array.tcc bits/valarray_meta.h bits/std_valarray.h bits/mask_array.h bits/slice.h bits/slice_array.h bits/gslice.h bits/gslice_array.h bits/indirect_array.h bits/exception_support.h bits/std_fstream.h bits/std_iomanip.h bits/ios_base.h bits/fpos.h bits/basic_ios.h bits/basic_ios.tcc bits/std_ios.h bits/std_iosfwd.h bits/std_iostream.h bits/std_istream.h bits/istream.tcc bits/std_locale.h bits/fstream.tcc bits/ostream.tcc bits/sbuf_iter.h bits/sstream.tcc bits/std_ostream.h bits/std_sstream.h bits/std_streambuf.h bits/streambuf.tcc bits/basic_file.h bits/locale_facets.h bits/locale_facets.tcc bits/localefwd.h bits/stl_pthread_alloc.h bits/pthread_allocimpl.h bits/stl_threads.h bits/stl_iterator_base.h bits/std_bitset.h bits/std_deque.h bits/std_functional.h bits/std_iterator.h bits/std_list.h bits/std_map.h bits/std_memory.h bits/std_numeric.h bits/std_queue.h bits/std_set.h bits/std_stack.h bits/std_stdexcept.h bits/std_vector.h bits/stl_algo.h bits/stl_algobase.h bits/stl_alloc.h bits/stl_deque.h bits/stl_function.h bits/stl_heap.h bits/stl_iterator.h bits/stl_list.h bits/stl_map.h bits/stl_multimap.h bits/stl_multiset.h bits/stl_numeric.h bits/stl_pair.h bits/stl_queue.h bits/stl_raw_storage_iter.h bits/stl_relops.h bits/stl_set.h bits/stl_stack.h bits/stl_tempbuf.h bits/stl_tree.h bits/stl_uninitialized.h bits/stl_vector.h bits/type_traits.h bits/stl_range_errors.h bits/std_algorithm.h bits/concept_checks.h bits/container_concepts.h bits/sequence_concepts.h bits/stl_config.h bits/stl_construct.h
|
||||
|
||||
|
||||
backward_headers = backward/complex.h backward/iomanip.h backward/istream.h backward/ostream.h backward/stream.h backward/streambuf.h backward/algo.h backward/algobase.h backward/alloc.h backward/bvector.h backward/defalloc.h backward/deque.h backward/function.h backward/hash_map.h backward/hash_set.h backward/hashtable.h backward/heap.h backward/iterator.h backward/list.h backward/map.h backward/multimap.h backward/new.h backward/multiset.h backward/pair.h backward/iostream.h backward/rope.h backward/set.h backward/slist.h backward/stack.h backward/tempbuf.h backward/tree.h backward/vector.h backward/fstream.h backward/strstream.h backward/strstream
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Methods for Exception Support for -*- C++ -*-
|
||||
|
||||
// Copyright (C) 1997-1999 Free Software Foundation, Inc.
|
||||
// Copyright (C) 1997, 1999, 2001 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
@ -27,28 +27,59 @@
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
// Written by Mike Stump based upon the specification in the 20 September 1994
|
||||
// C++ working paper, ANSI document X3J16/94-0158.
|
||||
|
||||
//
|
||||
// ISO C++ 14882: 19.1 Exception classes
|
||||
//
|
||||
|
||||
#include <bits/std_string.h>
|
||||
#include <bits/std_stdexcept.h>
|
||||
#if 1
|
||||
#include <bits/stl_range_errors.h>
|
||||
#endif
|
||||
|
||||
// To break the circularity with the <stdexcept> and <string> header we
|
||||
// define two functions which throw exceptions as a direct call would do.
|
||||
namespace std
|
||||
{
|
||||
logic_error::logic_error(const string& __arg)
|
||||
: exception(), _M_msg(__arg) { }
|
||||
|
||||
namespace std {
|
||||
logic_error::~logic_error() throw() { };
|
||||
|
||||
__Named_exception::__Named_exception(const string& __str)
|
||||
{
|
||||
strncpy(_M_name, __str.c_str(), _S_bufsize);
|
||||
_M_name[_S_bufsize - 1] = '\0';
|
||||
}
|
||||
const char*
|
||||
logic_error::what() const throw()
|
||||
{ return _M_msg.c_str(); }
|
||||
|
||||
domain_error::domain_error(const string& __arg)
|
||||
: logic_error(__arg) { }
|
||||
|
||||
invalid_argument::invalid_argument(const string& __arg)
|
||||
: logic_error(__arg) { }
|
||||
|
||||
length_error::length_error(const string& __arg)
|
||||
: logic_error(__arg) { }
|
||||
|
||||
out_of_range::out_of_range(const string& __arg)
|
||||
: logic_error(__arg) { }
|
||||
|
||||
runtime_error::runtime_error(const string& __arg)
|
||||
: exception(), _M_msg(__arg) { }
|
||||
|
||||
runtime_error::~runtime_error() throw() { };
|
||||
|
||||
const char*
|
||||
runtime_error::what() const throw()
|
||||
{ return _M_msg.c_str(); }
|
||||
|
||||
range_error::range_error(const string& __arg)
|
||||
: runtime_error(__arg) { }
|
||||
|
||||
overflow_error::overflow_error(const string& __arg)
|
||||
: runtime_error(__arg) { }
|
||||
|
||||
underflow_error::underflow_error(const string& __arg)
|
||||
: runtime_error(__arg) { }
|
||||
|
||||
#if 1
|
||||
// XXX need to deal with this.
|
||||
void
|
||||
__out_of_range(const char *str)
|
||||
{ throw out_of_range(str); }
|
||||
@ -66,8 +97,8 @@ namespace std {
|
||||
void
|
||||
__stl_throw_length_error(const char* __msg)
|
||||
{ throw length_error(__msg); }
|
||||
|
||||
} //namespace std
|
||||
#endif
|
||||
} // namespace std
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user