Commit b2acb86f by Benjamin Kosnik Committed by Benjamin Kosnik

stl_alloc.h: Cleanups.



2003-06-06  Benjamin Kosnik  <bkoz@redhat.com>

	* include/bits/stl_alloc.h: Cleanups.
	* include/ext/functional: Same.
	* include/ext/hash_map: Same.
	* include/ext/hash_set: Same.
	* include/ext/iterator: Same.
	* include/ext/memory: Same.
	* include/ext/numeric: Same.
	* include/ext/rb_tree: Same.
	* include/ext/ropeimpl.h: Same.
	* include/ext/slist: Same.
	* include/ext/stdio_filebuf.h: Same.
	* include/ext/stdio_sync_filebuf.h: Same.
	* include/ext/stl_rope.h: Move to...
	* include/ext/rope: ...here.
	* include/ext/stl_hash_fun.h: Move to...
	* include/ext/hash_fun.h: ...here.
	* include/ext/stl_hashtable.h: Move to...
	* include/ext/hashtable.h: ...here.
	* include/backward/hashtable.h: Reflect new names.
	* include/Makefile.am: Same.
	* include/Makefile.in: Regenerated.

From-SVN: r67551
parent 744f6f09
2003-06-06 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/stl_alloc.h: Cleanups.
* include/ext/functional: Same.
* include/ext/hash_map: Same.
* include/ext/hash_set: Same.
* include/ext/iterator: Same.
* include/ext/memory: Same.
* include/ext/numeric: Same.
* include/ext/rb_tree: Same.
* include/ext/ropeimpl.h: Same.
* include/ext/slist: Same.
* include/ext/stdio_filebuf.h: Same.
* include/ext/stdio_sync_filebuf.h: Same.
* include/ext/stl_rope.h: Move to...
* include/ext/rope: ...here.
* include/ext/stl_hash_fun.h: Move to...
* include/ext/hash_fun.h: ...here.
* include/ext/stl_hashtable.h: Move to...
* include/ext/hashtable.h: ...here.
* include/backward/hashtable.h: Reflect new names.
* include/Makefile.am: Same.
* include/Makefile.in: Regenerated.
2003-06-05 Benjamin Kosnik <bkoz@redhat.com> 2003-06-05 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/9024 PR libstdc++/9024
......
...@@ -228,9 +228,9 @@ ext_headers = \ ...@@ -228,9 +228,9 @@ ext_headers = \
${ext_srcdir}/rope \ ${ext_srcdir}/rope \
${ext_srcdir}/ropeimpl.h \ ${ext_srcdir}/ropeimpl.h \
${ext_srcdir}/slist \ ${ext_srcdir}/slist \
${ext_srcdir}/stl_hash_fun.h \ ${ext_srcdir}/hash_fun.h \
${ext_srcdir}/stl_hashtable.h \ ${ext_srcdir}/hashtable.h
${ext_srcdir}/stl_rope.h
# This is the common subset of files that all three "C" header models use. # This is the common subset of files that all three "C" header models use.
c_base_srcdir = @C_INCLUDE_DIR@ c_base_srcdir = @C_INCLUDE_DIR@
......
...@@ -126,6 +126,7 @@ enable_shared = @enable_shared@ ...@@ -126,6 +126,7 @@ enable_shared = @enable_shared@
enable_static = @enable_static@ enable_static = @enable_static@
glibcpp_CXX = @glibcpp_CXX@ glibcpp_CXX = @glibcpp_CXX@
glibcpp_MOFILES = @glibcpp_MOFILES@ glibcpp_MOFILES = @glibcpp_MOFILES@
glibcpp_PCHFLAGS = @glibcpp_PCHFLAGS@
glibcpp_POFILES = @glibcpp_POFILES@ glibcpp_POFILES = @glibcpp_POFILES@
glibcpp_basedir = @glibcpp_basedir@ glibcpp_basedir = @glibcpp_basedir@
glibcpp_localedir = @glibcpp_localedir@ glibcpp_localedir = @glibcpp_localedir@
...@@ -348,9 +349,8 @@ ext_headers = \ ...@@ -348,9 +349,8 @@ ext_headers = \
${ext_srcdir}/rope \ ${ext_srcdir}/rope \
${ext_srcdir}/ropeimpl.h \ ${ext_srcdir}/ropeimpl.h \
${ext_srcdir}/slist \ ${ext_srcdir}/slist \
${ext_srcdir}/stl_hash_fun.h \ ${ext_srcdir}/hash_fun.h \
${ext_srcdir}/stl_hashtable.h \ ${ext_srcdir}/hashtable.h
${ext_srcdir}/stl_rope.h
# This is the common subset of files that all three "C" header models use. # This is the common subset of files that all three "C" header models use.
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
#define _CPP_BACKWARD_HASHTABLE_H 1 #define _CPP_BACKWARD_HASHTABLE_H 1
#include "backward_warning.h" #include "backward_warning.h"
#include <ext/stl_hashtable.h> #include <ext/hashtable.h>
#include "algo.h" #include "algo.h"
#include "alloc.h" #include "alloc.h"
#include "vector.h" #include "vector.h"
......
...@@ -83,7 +83,6 @@ ...@@ -83,7 +83,6 @@
#include <cstring> #include <cstring>
#include <bits/functexcept.h> // For __throw_bad_alloc #include <bits/functexcept.h> // For __throw_bad_alloc
#include <bits/stl_threads.h> #include <bits/stl_threads.h>
#include <bits/atomicity.h> #include <bits/atomicity.h>
namespace std namespace std
...@@ -172,8 +171,6 @@ namespace std ...@@ -172,8 +171,6 @@ namespace std
} }
} }
// Should not be referenced within the library anymore.
typedef __new_alloc __mem_interface;
/** /**
* @if maint * @if maint
......
...@@ -60,9 +60,10 @@ ...@@ -60,9 +60,10 @@
*/ */
#ifndef _EXT_FUNCTIONAL #ifndef _EXT_FUNCTIONAL
#define _EXT_FUNCTIONAL #define _EXT_FUNCTIONAL 1
#pragma GCC system_header #pragma GCC system_header
#include <functional> #include <functional>
namespace __gnu_cxx namespace __gnu_cxx
...@@ -388,8 +389,7 @@ template <class _Ret, class _Tp, class _Arg> ...@@ -388,8 +389,7 @@ template <class _Ret, class _Tp, class _Arg>
inline const_mem_fun1_ref_t<_Ret,_Tp,_Arg> inline const_mem_fun1_ref_t<_Ret,_Tp,_Arg>
mem_fun1_ref(_Ret (_Tp::*__f)(_Arg) const) mem_fun1_ref(_Ret (_Tp::*__f)(_Arg) const)
{ return const_mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); } { return const_mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); }
} // namespace __gnu_cxx } // namespace __gnu_cxx
#endif /* _EXT_FUNCTIONAL */ #endif
// 'struct hash' from SGI -*- C++ -*- // 'struct hash' from SGI -*- C++ -*-
// Copyright (C) 2001, 2002 Free Software Foundation, Inc. // Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -53,74 +53,70 @@ ...@@ -53,74 +53,70 @@
* *
*/ */
/** @file ext/stl_hash_fun.h /** @file ext/hash_fun.h
* This file is a GNU extension to the Standard C++ Library (possibly * This file is a GNU extension to the Standard C++ Library (possibly
* containing extensions from the HP/SGI STL subset). You should only * containing extensions from the HP/SGI STL subset). You should only
* include this header if you are using GCC 3 or later. * include this header if you are using GCC 3 or later.
*/ */
#ifndef _CPP_BITS_STL_HASH_FUN_H #ifndef _HASH_FUN_H
#define _CPP_BITS_STL_HASH_FUN_H 1 #define _HASH_FUN_H 1
#include <cstddef> #include <cstddef>
namespace __gnu_cxx namespace __gnu_cxx
{ {
using std::size_t; using std::size_t;
template <class _Key> struct hash { };
inline size_t
__stl_hash_string(const char* __s)
{
unsigned long __h = 0;
for ( ; *__s; ++__s)
__h = 5*__h + *__s;
return size_t(__h);
}
template<> struct hash<char*>
{
size_t operator()(const char* __s) const
{ return __stl_hash_string(__s); }
};
template<> struct hash<const char*>
{
size_t operator()(const char* __s) const
{ return __stl_hash_string(__s); }
};
template <class _Key> struct hash { }; template<> struct hash<char>
{ size_t operator()(char __x) const { return __x; } };
inline size_t __stl_hash_string(const char* __s) template<> struct hash<unsigned char>
{ { size_t operator()(unsigned char __x) const { return __x; } };
unsigned long __h = 0;
for ( ; *__s; ++__s)
__h = 5*__h + *__s;
return size_t(__h);
}
template<> struct hash<char*> template<> struct hash<signed char>
{ { size_t operator()(unsigned char __x) const { return __x; } };
size_t operator()(const char* __s) const { return __stl_hash_string(__s); }
};
template<> struct hash<const char*> template<> struct hash<short>
{ { size_t operator()(short __x) const { return __x; } };
size_t operator()(const char* __s) const { return __stl_hash_string(__s); }
};
template<> struct hash<char> {
size_t operator()(char __x) const { return __x; }
};
template<> struct hash<unsigned char> {
size_t operator()(unsigned char __x) const { return __x; }
};
template<> struct hash<signed char> {
size_t operator()(unsigned char __x) const { return __x; }
};
template<> struct hash<short> {
size_t operator()(short __x) const { return __x; }
};
template<> struct hash<unsigned short> {
size_t operator()(unsigned short __x) const { return __x; }
};
template<> struct hash<int> {
size_t operator()(int __x) const { return __x; }
};
template<> struct hash<unsigned int> {
size_t operator()(unsigned int __x) const { return __x; }
};
template<> struct hash<long> {
size_t operator()(long __x) const { return __x; }
};
template<> struct hash<unsigned long> {
size_t operator()(unsigned long __x) const { return __x; }
};
} // namespace __gnu_cxx template<> struct hash<unsigned short>
{ size_t operator()(unsigned short __x) const { return __x; } };
template<> struct hash<int>
{ size_t operator()(int __x) const { return __x; } };
template<> struct hash<unsigned int>
{ size_t operator()(unsigned int __x) const { return __x; } };
#endif /* _CPP_BITS_STL_HASH_FUN_H */ template<> struct hash<long>
{ size_t operator()(long __x) const { return __x; } };
template<> struct hash<unsigned long>
{ size_t operator()(unsigned long __x) const { return __x; } };
} // namespace __gnu_cxx
// Local Variables: #endif
// mode:C++
// End:
...@@ -59,30 +59,28 @@ ...@@ -59,30 +59,28 @@
* include this header if you are using GCC 3 or later. * include this header if you are using GCC 3 or later.
*/ */
#ifndef __SGI_STL_INTERNAL_HASH_MAP_H #ifndef _HASH_MAP
#define __SGI_STL_INTERNAL_HASH_MAP_H #define _HASH_MAP 1
#include <ext/stl_hashtable.h> #include <ext/hashtable.h>
#include <bits/concept_check.h> #include <bits/concept_check.h>
namespace __gnu_cxx namespace __gnu_cxx
{ {
using std::equal_to; using std::equal_to;
using std::allocator; using std::allocator;
using std::pair; using std::pair;
using std::_Select1st; using std::_Select1st;
// Forward declaration of equality operator; needed for friend declaration. // Forward declaration of equality operator; needed for friend
// declaration.
template <class _Key, class _Tp, template<class _Key, class _Tp, class _HashFcn = hash<_Key>,
class _HashFcn = hash<_Key>, class _EqualKey = equal_to<_Key>, class _Alloc = allocator<_Tp> >
class _EqualKey = equal_to<_Key>, class hash_map;
class _Alloc = allocator<_Tp> >
class hash_map; template<class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc>
inline bool operator==(const hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc>&,
template <class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc> const hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc>&);
inline bool operator==(const hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc>&,
const hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc>&);
/** /**
* This is an SGI extension. * This is an SGI extension.
* @ingroup SGIextensions * @ingroup SGIextensions
...@@ -444,11 +442,6 @@ public: ...@@ -444,11 +442,6 @@ public:
insert_iterator<_Container>& operator++() { return *this; } insert_iterator<_Container>& operator++() { return *this; }
insert_iterator<_Container>& operator++(int) { return *this; } insert_iterator<_Container>& operator++(int) { return *this; }
}; };
} // namespace std } // namespace std
#endif /* __SGI_STL_INTERNAL_HASH_MAP_H */ #endif
// Local Variables:
// mode:C++
// End:
...@@ -59,31 +59,30 @@ ...@@ -59,31 +59,30 @@
* include this header if you are using GCC 3 or later. * include this header if you are using GCC 3 or later.
*/ */
#ifndef __SGI_STL_INTERNAL_HASH_SET_H #ifndef _HASH_SET
#define __SGI_STL_INTERNAL_HASH_SET_H #define _HASH_SET 1
#include <ext/stl_hashtable.h> #include <ext/hashtable.h>
#include <bits/concept_check.h> #include <bits/concept_check.h>
namespace __gnu_cxx namespace __gnu_cxx
{ {
using std::equal_to; using std::equal_to;
using std::allocator; using std::allocator;
using std::pair; using std::pair;
using std::_Identity; using std::_Identity;
// Forward declaration of equality operator; needed for friend declaration. // Forward declaration of equality operator; needed for friend
// declaration.
template <class _Value, template <class _Value, class _HashFcn = hash<_Value>,
class _HashFcn = hash<_Value>, class _EqualKey = equal_to<_Value>,
class _EqualKey = equal_to<_Value>, class _Alloc = allocator<_Value> >
class _Alloc = allocator<_Value> > class hash_set;
class hash_set;
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc> inline bool
inline bool operator==(const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1,
operator==(const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1, const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs2);
const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs2);
/** /**
* This is an SGI extension. * This is an SGI extension.
...@@ -435,11 +434,6 @@ public: ...@@ -435,11 +434,6 @@ public:
insert_iterator<_Container>& operator++() { return *this; } insert_iterator<_Container>& operator++() { return *this; }
insert_iterator<_Container>& operator++(int) { return *this; } insert_iterator<_Container>& operator++(int) { return *this; }
}; };
} // namespace std } // namespace std
#endif /* __SGI_STL_INTERNAL_HASH_SET_H */ #endif
// Local Variables:
// mode:C++
// End:
...@@ -53,14 +53,14 @@ ...@@ -53,14 +53,14 @@
* *
*/ */
/** @file ext/stl_hashtable.h /** @file ext/hashtable.h
* This file is a GNU extension to the Standard C++ Library (possibly * This file is a GNU extension to the Standard C++ Library (possibly
* containing extensions from the HP/SGI STL subset). You should only * containing extensions from the HP/SGI STL subset). You should only
* include this header if you are using GCC 3 or later. * include this header if you are using GCC 3 or later.
*/ */
#ifndef __SGI_STL_INTERNAL_HASHTABLE_H #ifndef _HASHTABLE_H
#define __SGI_STL_INTERNAL_HASHTABLE_H #define _HASHTABLE_H 1
// Hashtable class, used to implement the hashed associative containers // Hashtable class, used to implement the hashed associative containers
// hash_set, hash_map, hash_multiset, and hash_multimap. // hash_set, hash_map, hash_multiset, and hash_multimap.
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
#include <iterator> #include <iterator>
#include <bits/stl_algo.h> #include <bits/stl_algo.h>
#include <bits/stl_function.h> #include <bits/stl_function.h>
#include <ext/stl_hash_fun.h> #include <ext/hash_fun.h>
namespace __gnu_cxx namespace __gnu_cxx
{ {
...@@ -210,13 +210,14 @@ bool operator==(const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht1, ...@@ -210,13 +210,14 @@ bool operator==(const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht1,
const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht2); const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht2);
// Hashtables handle allocators a bit differently than other containers // Hashtables handle allocators a bit differently than other
// do. If we're using standard-conforming allocators, then a hashtable // containers do. If we're using standard-conforming allocators, then
// unconditionally has a member variable to hold its allocator, even if // a hashtable unconditionally has a member variable to hold its
// it so happens that all instances of the allocator type are identical. // allocator, even if it so happens that all instances of the
// This is because, for hashtables, this extra storage is negligible. // allocator type are identical. This is because, for hashtables,
// Additionally, a base class wouldn't serve any other purposes; it // this extra storage is negligible. Additionally, a base class
// wouldn't, for example, simplify the exception-handling code. // wouldn't serve any other purposes; it wouldn't, for example,
// simplify the exception-handling code.
template <class _Val, class _Key, class _HashFcn, template <class _Val, class _Key, class _HashFcn,
class _ExtractKey, class _EqualKey, class _Alloc> class _ExtractKey, class _EqualKey, class _Alloc>
...@@ -986,11 +987,6 @@ void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All> ...@@ -986,11 +987,6 @@ void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
__throw_exception_again; __throw_exception_again;
} }
} }
} // namespace __gnu_cxx } // namespace __gnu_cxx
#endif /* __SGI_STL_INTERNAL_HASHTABLE_H */ #endif
// Local Variables:
// mode:C++
// End:
...@@ -60,19 +60,20 @@ ...@@ -60,19 +60,20 @@
*/ */
#ifndef _EXT_ITERATOR #ifndef _EXT_ITERATOR
#define _EXT_ITERATOR #define _EXT_ITERATOR 1
#pragma GCC system_header #pragma GCC system_header
#include <bits/concept_check.h> #include <bits/concept_check.h>
#include <iterator> #include <iterator>
namespace __gnu_cxx namespace __gnu_cxx
{ {
// There are two signatures for distance. In addition to the one
// There are two signatures for distance. In addition to the one taking // taking two iterators and returning a result, there is another
// two iterators and returning a result, there is another taking two // taking two iterators and a reference-to-result variable, and
// iterators and a reference-to-result variable, and returning nothing. // returning nothing. The latter seems to be an SGI extension.
// The latter seems to be an SGI extension. -- pedwards // -- pedwards
template<typename _InputIterator, typename _Distance> template<typename _InputIterator, typename _Distance>
inline void inline void
__distance(_InputIterator __first, _InputIterator __last, __distance(_InputIterator __first, _InputIterator __last,
...@@ -106,8 +107,7 @@ namespace __gnu_cxx ...@@ -106,8 +107,7 @@ namespace __gnu_cxx
// concept requirements -- taken care of in __distance // concept requirements -- taken care of in __distance
__distance(__first, __last, __n, std::__iterator_category(__first)); __distance(__first, __last, __n, std::__iterator_category(__first));
} }
} // namespace __gnu_cxx } // namespace __gnu_cxx
#endif /* _EXT_ITERATOR */ #endif
...@@ -60,9 +60,10 @@ ...@@ -60,9 +60,10 @@
*/ */
#ifndef _EXT_MEMORY #ifndef _EXT_MEMORY
#define _EXT_MEMORY #define _EXT_MEMORY 1
#pragma GCC system_header #pragma GCC system_header
#include <memory> #include <memory>
#include <bits/stl_tempbuf.h> #include <bits/stl_tempbuf.h>
...@@ -73,30 +74,29 @@ namespace __gnu_cxx ...@@ -73,30 +74,29 @@ namespace __gnu_cxx
using std::__iterator_category; using std::__iterator_category;
using std::_Temporary_buffer; using std::_Temporary_buffer;
template<typename _InputIter, typename _Size, typename _ForwardIter> template<typename _InputIter, typename _Size, typename _ForwardIter>
pair<_InputIter, _ForwardIter> pair<_InputIter, _ForwardIter>
__uninitialized_copy_n(_InputIter __first, _Size __count, __uninitialized_copy_n(_InputIter __first, _Size __count,
_ForwardIter __result, _ForwardIter __result, std::input_iterator_tag)
std::input_iterator_tag)
{ {
_ForwardIter __cur = __result; _ForwardIter __cur = __result;
try { try
for ( ; __count > 0 ; --__count, ++__first, ++__cur) {
std::_Construct(&*__cur, *__first); for ( ; __count > 0 ; --__count, ++__first, ++__cur)
return pair<_InputIter, _ForwardIter>(__first, __cur); std::_Construct(&*__cur, *__first);
} return pair<_InputIter, _ForwardIter>(__first, __cur);
}
catch(...) catch(...)
{ {
std::_Destroy(__result, __cur); std::_Destroy(__result, __cur);
__throw_exception_again; __throw_exception_again;
} }
} }
template<typename _RandomAccessIter, typename _Size, typename _ForwardIter> template<typename _RandomAccessIter, typename _Size, typename _ForwardIter>
inline pair<_RandomAccessIter, _ForwardIter> inline pair<_RandomAccessIter, _ForwardIter>
__uninitialized_copy_n(_RandomAccessIter __first, _Size __count, __uninitialized_copy_n(_RandomAccessIter __first, _Size __count,
_ForwardIter __result, _ForwardIter __result,
std::random_access_iterator_tag) std::random_access_iterator_tag)
{ {
_RandomAccessIter __last = __first + __count; _RandomAccessIter __last = __first + __count;
...@@ -108,7 +108,8 @@ namespace __gnu_cxx ...@@ -108,7 +108,8 @@ namespace __gnu_cxx
template<typename _InputIter, typename _Size, typename _ForwardIter> template<typename _InputIter, typename _Size, typename _ForwardIter>
inline pair<_InputIter, _ForwardIter> inline pair<_InputIter, _ForwardIter>
__uninitialized_copy_n(_InputIter __first, _Size __count, __uninitialized_copy_n(_InputIter __first, _Size __count,
_ForwardIter __result) { _ForwardIter __result)
{
return __uninitialized_copy_n(__first, __count, __result, return __uninitialized_copy_n(__first, __count, __result,
__iterator_category(__first)); __iterator_category(__first));
} }
...@@ -126,7 +127,8 @@ namespace __gnu_cxx ...@@ -126,7 +127,8 @@ namespace __gnu_cxx
template<typename _InputIter, typename _Size, typename _ForwardIter> template<typename _InputIter, typename _Size, typename _ForwardIter>
inline pair<_InputIter, _ForwardIter> inline pair<_InputIter, _ForwardIter>
uninitialized_copy_n(_InputIter __first, _Size __count, uninitialized_copy_n(_InputIter __first, _Size __count,
_ForwardIter __result) { _ForwardIter __result)
{
return __uninitialized_copy_n(__first, __count, __result, return __uninitialized_copy_n(__first, __count, __result,
__iterator_category(__first)); __iterator_category(__first));
} }
...@@ -152,19 +154,18 @@ namespace __gnu_cxx ...@@ -152,19 +154,18 @@ namespace __gnu_cxx
* *
* @ingroup SGIextensions * @ingroup SGIextensions
*/ */
template <class _ForwardIterator, template <class _ForwardIterator, class _Tp
class _Tp
= typename std::iterator_traits<_ForwardIterator>::value_type > = typename std::iterator_traits<_ForwardIterator>::value_type >
struct temporary_buffer : public _Temporary_buffer<_ForwardIterator, _Tp> struct temporary_buffer : public _Temporary_buffer<_ForwardIterator, _Tp>
{ {
/// Requests storage large enough to hold a copy of [first,last). /// Requests storage large enough to hold a copy of [first,last).
temporary_buffer(_ForwardIterator __first, _ForwardIterator __last) temporary_buffer(_ForwardIterator __first, _ForwardIterator __last)
: _Temporary_buffer<_ForwardIterator, _Tp>(__first, __last) {} : _Temporary_buffer<_ForwardIterator, _Tp>(__first, __last) { }
/// Destroys objects and frees storage. /// Destroys objects and frees storage.
~temporary_buffer() {} ~temporary_buffer() { }
}; };
} // namespace __gnu_cxx } // namespace __gnu_cxx
#endif /* _EXT_MEMORY */ #endif
...@@ -60,9 +60,10 @@ ...@@ -60,9 +60,10 @@
*/ */
#ifndef _EXT_NUMERIC #ifndef _EXT_NUMERIC
#define _EXT_NUMERIC #define _EXT_NUMERIC 1
#pragma GCC system_header #pragma GCC system_header
#include <bits/concept_check.h> #include <bits/concept_check.h>
#include <numeric> #include <numeric>
...@@ -71,8 +72,7 @@ ...@@ -71,8 +72,7 @@
namespace __gnu_cxx namespace __gnu_cxx
{ {
// Returns __x ** __n, where __n >= 0. _Note that "multiplication" // Returns __x ** __n, where __n >= 0. _Note that "multiplication"
// is required to be associative, but not necessarily commutative. // is required to be associative, but not necessarily commutative.
template<typename _Tp, typename _Integer, typename _MonoidOperation> template<typename _Tp, typename _Integer, typename _MonoidOperation>
_Tp _Tp
__power(_Tp __x, _Integer __n, _MonoidOperation __monoid_op) __power(_Tp __x, _Integer __n, _MonoidOperation __monoid_op)
...@@ -102,14 +102,13 @@ namespace __gnu_cxx ...@@ -102,14 +102,13 @@ namespace __gnu_cxx
__power(_Tp __x, _Integer __n) __power(_Tp __x, _Integer __n)
{ return __power(__x, __n, std::multiplies<_Tp>()); } { return __power(__x, __n, std::multiplies<_Tp>()); }
// Alias for the internal name __power. Note that power is an extension,
// not part of the C++ standard.
/** /**
* This is an SGI extension. * This is an SGI extension.
* @ingroup SGIextensions * @ingroup SGIextensions
* @doctodo * @doctodo
*/ */
// Alias for the internal name __power. Note that power is an extension,
// not part of the C++ standard.
template<typename _Tp, typename _Integer, typename _MonoidOperation> template<typename _Tp, typename _Integer, typename _MonoidOperation>
inline _Tp inline _Tp
power(_Tp __x, _Integer __n, _MonoidOperation __monoid_op) power(_Tp __x, _Integer __n, _MonoidOperation __monoid_op)
...@@ -125,13 +124,12 @@ namespace __gnu_cxx ...@@ -125,13 +124,12 @@ namespace __gnu_cxx
power(_Tp __x, _Integer __n) power(_Tp __x, _Integer __n)
{ return __power(__x, __n); } { return __power(__x, __n); }
// iota is not part of the C++ standard. It is an extension.
/** /**
* This is an SGI extension. * This is an SGI extension.
* @ingroup SGIextensions * @ingroup SGIextensions
* @doctodo * @doctodo
*/ */
// iota is not part of the C++ standard. It is an extension.
template<typename _ForwardIter, typename _Tp> template<typename _ForwardIter, typename _Tp>
void void
iota(_ForwardIter __first, _ForwardIter __last, _Tp __value) iota(_ForwardIter __first, _ForwardIter __last, _Tp __value)
...@@ -144,8 +142,7 @@ namespace __gnu_cxx ...@@ -144,8 +142,7 @@ namespace __gnu_cxx
while (__first != __last) while (__first != __last)
*__first++ = __value++; *__first++ = __value++;
} }
} // namespace __gnu_cxx } // namespace __gnu_cxx
#endif /* _EXT_NUMERIC */ #endif
...@@ -59,39 +59,39 @@ ...@@ -59,39 +59,39 @@
* include this header if you are using GCC 3 or later. * include this header if you are using GCC 3 or later.
*/ */
#ifndef _EXT_RB_TREE #ifndef _RB_TREE
#define _EXT_RB_TREE #define _RB_TREE 1
#pragma GCC system_header #pragma GCC system_header
#include <bits/stl_tree.h> #include <bits/stl_tree.h>
namespace __gnu_cxx namespace __gnu_cxx
{ {
using std::_Rb_tree; using std::_Rb_tree;
using std::allocator; using std::allocator;
// Class rb_tree is not part of the C++ standard. It is provided for
// compatibility with the HP STL.
/**
* This is an SGI extension.
* @ingroup SGIextensions
* @doctodo
*/
template <class _Key, class _Value, class _KeyOfValue, class _Compare,
class _Alloc = allocator<_Value> >
struct rb_tree : public _Rb_tree<_Key, _Value, _KeyOfValue, _Compare, _Alloc>
{
typedef _Rb_tree<_Key, _Value, _KeyOfValue, _Compare, _Alloc> _Base;
typedef typename _Base::allocator_type allocator_type;
rb_tree(const _Compare& __comp = _Compare(),
const allocator_type& __a = allocator_type())
: _Base(__comp, __a) {}
~rb_tree() {} // Class rb_tree is not part of the C++ standard. It is provided for
}; // compatibility with the HP STL.
/**
* This is an SGI extension.
* @ingroup SGIextensions
* @doctodo
*/
template <class _Key, class _Value, class _KeyOfValue, class _Compare,
class _Alloc = allocator<_Value> >
struct rb_tree : public _Rb_tree<_Key, _Value, _KeyOfValue, _Compare, _Alloc>
{
typedef _Rb_tree<_Key, _Value, _KeyOfValue, _Compare, _Alloc> _Base;
typedef typename _Base::allocator_type allocator_type;
rb_tree(const _Compare& __comp = _Compare(),
const allocator_type& __a = allocator_type())
: _Base(__comp, __a) { }
~rb_tree() { }
};
} // namespace __gnu_cxx } // namespace __gnu_cxx
#endif /* _EXT_RB_TREE */ #endif
...@@ -55,13 +55,13 @@ ...@@ -55,13 +55,13 @@
namespace __gnu_cxx namespace __gnu_cxx
{ {
using std::size_t; using std::size_t;
using std::printf; using std::printf;
using std::basic_ostream; using std::basic_ostream;
using std::__throw_length_error; using std::__throw_length_error;
using std::__alloc; using std::__alloc;
using std::_Destroy; using std::_Destroy;
using std::uninitialized_fill_n; using std::uninitialized_fill_n;
// Set buf_start, buf_end, and buf_ptr appropriately, filling tmp_buf // Set buf_start, buf_end, and buf_ptr appropriately, filling tmp_buf
// if necessary. Assumes _M_path_end[leaf_index] and leaf_pos are correct. // if necessary. Assumes _M_path_end[leaf_index] and leaf_pos are correct.
......
...@@ -47,8 +47,8 @@ ...@@ -47,8 +47,8 @@
* include this header if you are using GCC 3 or later. * include this header if you are using GCC 3 or later.
*/ */
#ifndef __SGI_STL_INTERNAL_SLIST_H #ifndef _SLIST
#define __SGI_STL_INTERNAL_SLIST_H #define _SLIST 1
#include <bits/stl_algobase.h> #include <bits/stl_algobase.h>
#include <bits/stl_alloc.h> #include <bits/stl_alloc.h>
...@@ -950,8 +950,4 @@ public: ...@@ -950,8 +950,4 @@ public:
} // namespace std } // namespace std
#endif /* __SGI_STL_INTERNAL_SLIST_H */ #endif
// Local Variables:
// mode:C++
// End:
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
* This file is a GNU extension to the Standard C++ Library. * This file is a GNU extension to the Standard C++ Library.
*/ */
#ifndef _EXT_STDIO_FILEBUF #ifndef _STDIO_FILEBUF_H
#define _EXT_STDIO_FILEBUF #define _STDIO_FILEBUF_H 1
#pragma GCC system_header #pragma GCC system_header
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
* This file is a GNU extension to the Standard C++ Library. * This file is a GNU extension to the Standard C++ Library.
*/ */
#ifndef _EXT_STDIO_SYNC_FILEBUF #ifndef _STDIO_SYNC_FILEBUF_H
#define _EXT_STDIO_SYNC_FILEBUF #define _STDIO_SYNC_FILEBUF_H 1
#pragma GCC system_header #pragma GCC system_header
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment