Commit fa30fe72 by Bernardo Innocenti Committed by Bernardo Innocenti

algorithm, [...]: Remove trailing whitespace.

	* include/ext/algorithm, include/ext/debug_allocator.h,
	include/ext/enc_filebuf.h, include/ext/functional,
	include/ext/hash_fun.h, include/ext/hash_map, include/ext/hash_set,
	include/ext/hashtable.h, include/ext/iterator,
	include/ext/malloc_allocator.h, include/ext/memory,
	include/ext/mt_allocator.h, include/ext/numeric,
	include/ext/pod_char_traits.h, include/ext/pool_allocator.h,
	include/ext/rb_tree, include/ext/rope, include/ext/ropeimpl.h,
	include/ext/slist, include/ext/stdio_filebuf.h,
	include/ext/stdio_sync_filebuf.h: Remove trailing whitespace.

From-SVN: r74464
parent 526da49c
2003-12-09 Bernardo Innocenti <bernie@develer.com>
* include/ext/algorithm, include/ext/debug_allocator.h,
include/ext/enc_filebuf.h, include/ext/functional,
include/ext/hash_fun.h, include/ext/hash_map, include/ext/hash_set,
include/ext/hashtable.h, include/ext/iterator,
include/ext/malloc_allocator.h, include/ext/memory,
include/ext/mt_allocator.h, include/ext/numeric,
include/ext/pod_char_traits.h, include/ext/pool_allocator.h,
include/ext/rb_tree, include/ext/rope, include/ext/ropeimpl.h,
include/ext/slist, include/ext/stdio_filebuf.h,
include/ext/stdio_sync_filebuf.h: Remove trailing whitespace.
2003-12-09 Bernardo Innocenti <bernie@develer.com>
* include/debug/bitset, include/debug/debug.h, include/debug/deque,
include/debug/formatter.h, include/debug/hash_map.h,
include/debug/hash_multimap.h, include/debug/hash_multiset.h,
......
......@@ -160,11 +160,11 @@ namespace __gnu_cxx
const ptrdiff_t __len1 = __last1 - __first1;
const ptrdiff_t __len2 = __last2 - __first2;
const int __result = std::memcmp(__first1, __first2, min(__len1, __len2));
return __result != 0 ? __result
return __result != 0 ? __result
: (__len1 == __len2 ? 0 : (__len1 < __len2 ? -1 : 1));
}
inline int
inline int
__lexicographical_compare_3way(const char* __first1, const char* __last1,
const char* __first2, const char* __last2)
{
......@@ -295,7 +295,7 @@ namespace __gnu_cxx
typename _RandomNumberGenerator>
_OutputIterator
random_sample_n(_ForwardIterator __first, _ForwardIterator __last,
_OutputIterator __out, const _Distance __n,
_OutputIterator __out, const _Distance __n,
_RandomNumberGenerator& __rand)
{
// concept requirements
......@@ -330,7 +330,7 @@ namespace __gnu_cxx
{
_Distance __m = 0;
_Distance __t = __n;
for ( ; __first != __last && __m < __n; ++__m, ++__first)
for ( ; __first != __last && __m < __n; ++__m, ++__first)
__out[__m] = *__first;
while (__first != __last) {
......@@ -380,7 +380,7 @@ namespace __gnu_cxx
template<typename _InputIterator, typename _RandomAccessIterator>
inline _RandomAccessIterator
random_sample(_InputIterator __first, _InputIterator __last,
_RandomAccessIterator __out_first, _RandomAccessIterator __out_last)
_RandomAccessIterator __out_first, _RandomAccessIterator __out_last)
{
// concept requirements
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
......@@ -398,12 +398,12 @@ namespace __gnu_cxx
* @ingroup SGIextensions
* @doctodo
*/
template<typename _InputIterator, typename _RandomAccessIterator,
template<typename _InputIterator, typename _RandomAccessIterator,
typename _RandomNumberGenerator>
inline _RandomAccessIterator
random_sample(_InputIterator __first, _InputIterator __last,
_RandomAccessIterator __out_first, _RandomAccessIterator __out_last,
_RandomNumberGenerator& __rand)
_RandomNumberGenerator& __rand)
{
// concept requirements
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
......@@ -416,7 +416,7 @@ namespace __gnu_cxx
__out_first, __rand,
__out_last - __out_first);
}
/**
* This is an SGI extension.
* @ingroup SGIextensions
......@@ -448,7 +448,7 @@ namespace __gnu_cxx
// concept requirements
__glibcxx_function_requires(_RandomAccessIteratorConcept<_RandomAccessIterator>)
__glibcxx_function_requires(_BinaryPredicateConcept<_StrictWeakOrdering,
typename iterator_traits<_RandomAccessIterator>::value_type,
typename iterator_traits<_RandomAccessIterator>::value_type,
typename iterator_traits<_RandomAccessIterator>::value_type>)
__glibcxx_requires_valid_range(__first, __last);
......@@ -498,7 +498,7 @@ namespace __gnu_cxx
// concept requirements
__glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcxx_function_requires(_BinaryPredicateConcept<_StrictWeakOrdering,
typename iterator_traits<_ForwardIterator>::value_type,
typename iterator_traits<_ForwardIterator>::value_type,
typename iterator_traits<_ForwardIterator>::value_type>)
__glibcxx_requires_valid_range(__first, __last);
......
......@@ -41,7 +41,7 @@
*/
/** @file ext/debug_allocator.h
* This file is a GNU extension to the Standard C++ Library.
* This file is a GNU extension to the Standard C++ Library.
* You should only include this header if you are using GCC 3 or later.
*/
......@@ -125,7 +125,7 @@ namespace std
/// Versions for the __allocator adaptor used with the predefined
/// "SGI" style allocators.
template<typename _Tp, typename _Tp1, typename _Alloc>
struct _Alloc_traits<_Tp, __allocator<_Tp1,
struct _Alloc_traits<_Tp, __allocator<_Tp1,
__gnu_cxx::__debug_alloc<_Alloc> > >
{
static const bool _S_instanceless = true;
......
......@@ -39,7 +39,7 @@ namespace __gnu_cxx
struct enc_char_traits: public std::char_traits<_CharT>
{
typedef std::__enc_traits state_type;
typedef typename std::fpos<state_type> pos_type;
typedef typename std::fpos<state_type> pos_type;
};
template<typename _CharT>
......@@ -47,13 +47,13 @@ namespace __gnu_cxx
: public std::basic_filebuf<_CharT, enc_char_traits<_CharT> >
{
public:
typedef enc_char_traits<_CharT> traits_type;
typedef typename traits_type::state_type state_type;
typedef typename traits_type::pos_type pos_type;
typedef enc_char_traits<_CharT> traits_type;
typedef typename traits_type::state_type state_type;
typedef typename traits_type::pos_type pos_type;
enc_filebuf(state_type& __state)
: std::basic_filebuf<_CharT, enc_char_traits<_CharT> >()
{
{
// Set state type to something useful.
// Something more than copyconstructible is needed here, so
// require default and copy constructible + assignment operator.
......
......@@ -100,7 +100,7 @@ template <class _Tp> inline _Tp identity_element(std::multiplies<_Tp>) {
* Calling @c operator() with a single argument @c x returns @c f(g(x)).
* The function @c compose1 takes the two functions and constructs a
* @c unary_compose variable for you.
*
*
* @c binary_compose is constructed from three functors, @c f, @c g1,
* and @c g2. Its @c operator() returns @c f(g1(x),g2(x)). The function
* @compose2 takes f, g1, and g2, and constructs the @c binary_compose
......@@ -124,13 +124,13 @@ template <class _Tp> inline _Tp identity_element(std::multiplies<_Tp>) {
template <class _Operation1, class _Operation2>
class unary_compose
: public unary_function<typename _Operation2::argument_type,
typename _Operation1::result_type>
typename _Operation1::result_type>
{
protected:
_Operation1 _M_fn1;
_Operation2 _M_fn2;
public:
unary_compose(const _Operation1& __x, const _Operation2& __y)
unary_compose(const _Operation1& __x, const _Operation2& __y)
: _M_fn1(__x), _M_fn2(__y) {}
typename _Operation1::result_type
operator()(const typename _Operation2::argument_type& __x) const {
......@@ -140,7 +140,7 @@ public:
/// An \link SGIextensions SGI extension \endlink.
template <class _Operation1, class _Operation2>
inline unary_compose<_Operation1,_Operation2>
inline unary_compose<_Operation1,_Operation2>
compose1(const _Operation1& __fn1, const _Operation2& __fn2)
{
return unary_compose<_Operation1,_Operation2>(__fn1, __fn2);
......@@ -156,8 +156,8 @@ protected:
_Operation2 _M_fn2;
_Operation3 _M_fn3;
public:
binary_compose(const _Operation1& __x, const _Operation2& __y,
const _Operation3& __z)
binary_compose(const _Operation1& __x, const _Operation2& __y,
const _Operation3& __z)
: _M_fn1(__x), _M_fn2(__y), _M_fn3(__z) { }
typename _Operation1::result_type
operator()(const typename _Operation2::argument_type& __x) const {
......@@ -167,8 +167,8 @@ public:
/// An \link SGIextensions SGI extension \endlink.
template <class _Operation1, class _Operation2, class _Operation3>
inline binary_compose<_Operation1, _Operation2, _Operation3>
compose2(const _Operation1& __fn1, const _Operation2& __fn2,
inline binary_compose<_Operation1, _Operation2, _Operation3>
compose2(const _Operation1& __fn1, const _Operation2& __fn2,
const _Operation3& __fn3)
{
return binary_compose<_Operation1,_Operation2,_Operation3>
......@@ -220,7 +220,7 @@ struct _Project2nd : public binary_function<_Arg1, _Arg2, _Arg2> {
*/
/// An \link SGIextensions SGI extension \endlink.
template <class _Arg1, class _Arg2>
template <class _Arg1, class _Arg2>
struct project1st : public _Project1st<_Arg1, _Arg2> {};
/// An \link SGIextensions SGI extension \endlink.
......@@ -236,7 +236,7 @@ struct _Constant_void_fun {
_Constant_void_fun(const result_type& __v) : _M_val(__v) {}
const result_type& operator()() const { return _M_val; }
};
};
template <class _Result, class _Argument>
struct _Constant_unary_fun {
......@@ -279,7 +279,7 @@ struct _Constant_binary_fun {
template <class _Result>
struct constant_void_fun : public _Constant_void_fun<_Result> {
constant_void_fun(const _Result& __v) : _Constant_void_fun<_Result>(__v) {}
};
};
/// An \link SGIextensions SGI extension \endlink.
template <class _Result,
......@@ -317,7 +317,7 @@ inline constant_unary_fun<_Result,_Result> constant1(const _Result& __val)
/// An \link SGIextensions SGI extension \endlink.
template <class _Result>
inline constant_binary_fun<_Result,_Result,_Result>
inline constant_binary_fun<_Result,_Result,_Result>
constant2(const _Result& __val)
{
return constant_binary_fun<_Result,_Result,_Result>(__val);
......@@ -369,7 +369,7 @@ public:
subtractive_rng() { _M_initialize(161803398u); }
};
// Mem_fun adaptor helper functions mem_fun1 and mem_fun1_ref,
// Mem_fun adaptor helper functions mem_fun1 and mem_fun1_ref,
// provided for backward compatibility, they are no longer part of
// the C++ standard.
......@@ -391,5 +391,5 @@ mem_fun1_ref(_Ret (_Tp::*__f)(_Arg) const)
{ return const_mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); }
} // namespace __gnu_cxx
#endif
#endif
......@@ -70,53 +70,53 @@ namespace __gnu_cxx
template <class _Key> struct hash { };
inline size_t
inline size_t
__stl_hash_string(const char* __s)
{
unsigned long __h = 0;
unsigned long __h = 0;
for ( ; *__s; ++__s)
__h = 5*__h + *__s;
__h = 5*__h + *__s;
return size_t(__h);
}
template<> struct hash<char*>
{
size_t operator()(const char* __s) const
size_t operator()(const char* __s) const
{ return __stl_hash_string(__s); }
};
template<> struct hash<const char*>
{
size_t operator()(const char* __s) const
size_t operator()(const char* __s) const
{ return __stl_hash_string(__s); }
};
template<> struct hash<char>
template<> struct hash<char>
{ size_t operator()(char __x) const { return __x; } };
template<> struct hash<unsigned char>
template<> struct hash<unsigned char>
{ size_t operator()(unsigned char __x) const { return __x; } };
template<> struct hash<signed char>
template<> struct hash<signed char>
{ size_t operator()(unsigned char __x) const { return __x; } };
template<> struct hash<short>
template<> struct hash<short>
{ size_t operator()(short __x) const { return __x; } };
template<> struct hash<unsigned short>
template<> struct hash<unsigned short>
{ size_t operator()(unsigned short __x) const { return __x; } };
template<> struct hash<int>
template<> struct hash<int>
{ size_t operator()(int __x) const { return __x; } };
template<> struct hash<unsigned int>
template<> struct hash<unsigned int>
{ size_t operator()(unsigned int __x) const { return __x; } };
template<> struct hash<long>
template<> struct hash<long>
{ size_t operator()(long __x) const { return __x; } };
template<> struct hash<unsigned long>
template<> struct hash<unsigned long>
{ size_t operator()(unsigned long __x) const { return __x; } };
} // namespace __gnu_cxx
#endif
#endif
......@@ -59,7 +59,7 @@
* include this header if you are using GCC 3 or later.
*/
#ifndef _HASH_MAP
#ifndef _HASH_MAP
#define _HASH_MAP 1
#include <ext/hashtable.h>
......@@ -102,7 +102,7 @@ public:
typedef typename _Ht::value_type value_type;
typedef typename _Ht::hasher hasher;
typedef typename _Ht::key_equal key_equal;
typedef typename _Ht::size_type size_type;
typedef typename _Ht::difference_type difference_type;
typedef typename _Ht::pointer pointer;
......@@ -171,10 +171,10 @@ public:
void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_unique(__f,__l); }
pair<iterator,bool> insert_noresize(const value_type& __obj)
{ return _M_ht.insert_unique_noresize(__obj); }
{ return _M_ht.insert_unique_noresize(__obj); }
iterator find(const key_type& __key) { return _M_ht.find(__key); }
const_iterator find(const key_type& __key) const
const_iterator find(const key_type& __key) const
{ return _M_ht.find(__key); }
_Tp& operator[](const key_type& __key) {
......@@ -182,7 +182,7 @@ public:
}
size_type count(const key_type& __key) const { return _M_ht.count(__key); }
pair<iterator, iterator> equal_range(const key_type& __key)
{ return _M_ht.equal_range(__key); }
pair<const_iterator, const_iterator>
......@@ -202,7 +202,7 @@ public:
};
template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
inline bool
inline bool
operator==(const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm2)
{
......@@ -210,14 +210,14 @@ operator==(const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
}
template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
inline bool
inline bool
operator!=(const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm2) {
return !(__hm1 == __hm2);
}
template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
inline void
inline void
swap(hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm2)
{
......@@ -233,7 +233,7 @@ template <class _Key, class _Tp,
class hash_multimap;
template <class _Key, class _Tp, class _HF, class _EqKey, class _Alloc>
inline bool
inline bool
operator==(const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm1,
const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm2);
......@@ -253,7 +253,7 @@ class hash_multimap
private:
typedef hashtable<pair<const _Key, _Tp>, _Key, _HashFcn,
_Select1st<pair<const _Key, _Tp> >, _EqualKey, _Alloc>
_Select1st<pair<const _Key, _Tp> >, _EqualKey, _Alloc>
_Ht;
_Ht _M_ht;
......@@ -327,20 +327,20 @@ public:
const_iterator end() const { return _M_ht.end(); }
public:
iterator insert(const value_type& __obj)
iterator insert(const value_type& __obj)
{ return _M_ht.insert_equal(__obj); }
template <class _InputIterator>
void insert(_InputIterator __f, _InputIterator __l)
void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_equal(__f,__l); }
iterator insert_noresize(const value_type& __obj)
{ return _M_ht.insert_equal_noresize(__obj); }
{ return _M_ht.insert_equal_noresize(__obj); }
iterator find(const key_type& __key) { return _M_ht.find(__key); }
const_iterator find(const key_type& __key) const
const_iterator find(const key_type& __key) const
{ return _M_ht.find(__key); }
size_type count(const key_type& __key) const { return _M_ht.count(__key); }
pair<iterator, iterator> equal_range(const key_type& __key)
{ return _M_ht.equal_range(__key); }
pair<const_iterator, const_iterator>
......@@ -361,7 +361,7 @@ public:
};
template <class _Key, class _Tp, class _HF, class _EqKey, class _Alloc>
inline bool
inline bool
operator==(const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm1,
const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm2)
{
......@@ -369,14 +369,14 @@ operator==(const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm1,
}
template <class _Key, class _Tp, class _HF, class _EqKey, class _Alloc>
inline bool
inline bool
operator!=(const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm1,
const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm2) {
return !(__hm1 == __hm2);
}
template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
inline void
inline void
swap(hash_multimap<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
hash_multimap<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm2)
{
......@@ -407,7 +407,7 @@ public:
insert_iterator(_Container& __x, typename _Container::iterator)
: container(&__x) {}
insert_iterator<_Container>&
operator=(const typename _Container::value_type& __value) {
operator=(const typename _Container::value_type& __value) {
container->insert(__value);
return *this;
}
......@@ -434,7 +434,7 @@ public:
insert_iterator(_Container& __x, typename _Container::iterator)
: container(&__x) {}
insert_iterator<_Container>&
operator=(const typename _Container::value_type& __value) {
operator=(const typename _Container::value_type& __value) {
container->insert(__value);
return *this;
}
......
......@@ -75,12 +75,12 @@ namespace __gnu_cxx
// Forward declaration of equality operator; needed for friend
// declaration.
template <class _Value, class _HashFcn = hash<_Value>,
class _EqualKey = equal_to<_Value>,
class _EqualKey = equal_to<_Value>,
class _Alloc = allocator<_Value> >
class hash_set;
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
inline bool
inline bool
operator==(const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs2);
......@@ -98,7 +98,7 @@ class hash_set
__glibcxx_class_requires3(_EqualKey, _Value, _Value, _BinaryPredicateConcept)
private:
typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
_EqualKey, _Alloc> _Ht;
_Ht _M_ht;
......@@ -161,7 +161,7 @@ public:
bool empty() const { return _M_ht.empty(); }
void swap(hash_set& __hs) { _M_ht.swap(__hs._M_ht); }
template <class _Val, class _HF, class _EqK, class _Al>
template <class _Val, class _HF, class _EqK, class _Al>
friend bool operator== (const hash_set<_Val, _HF, _EqK, _Al>&,
const hash_set<_Val, _HF, _EqK, _Al>&);
......@@ -175,11 +175,11 @@ public:
return pair<iterator,bool>(__p.first, __p.second);
}
template <class _InputIterator>
void insert(_InputIterator __f, _InputIterator __l)
void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_unique(__f,__l); }
pair<iterator, bool> insert_noresize(const value_type& __obj)
{
pair<typename _Ht::iterator, bool> __p =
pair<typename _Ht::iterator, bool> __p =
_M_ht.insert_unique_noresize(__obj);
return pair<iterator, bool>(__p.first, __p.second);
}
......@@ -187,7 +187,7 @@ public:
iterator find(const key_type& __key) const { return _M_ht.find(__key); }
size_type count(const key_type& __key) const { return _M_ht.count(__key); }
pair<iterator, iterator> equal_range(const key_type& __key) const
{ return _M_ht.equal_range(__key); }
......@@ -205,7 +205,7 @@ public:
};
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
inline bool
inline bool
operator==(const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs2)
{
......@@ -213,14 +213,14 @@ operator==(const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1,
}
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
inline bool
inline bool
operator!=(const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs2) {
return !(__hs1 == __hs2);
}
template <class _Val, class _HashFcn, class _EqualKey, class _Alloc>
inline void
inline void
swap(hash_set<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
hash_set<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2)
{
......@@ -235,7 +235,7 @@ template <class _Value,
class hash_multiset;
template <class _Val, class _HashFcn, class _EqualKey, class _Alloc>
inline bool
inline bool
operator==(const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2);
......@@ -254,7 +254,7 @@ class hash_multiset
__glibcxx_class_requires3(_EqualKey, _Value, _Value, _BinaryPredicateConcept)
private:
typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
_EqualKey, _Alloc> _Ht;
_Ht _M_ht;
......@@ -317,7 +317,7 @@ public:
bool empty() const { return _M_ht.empty(); }
void swap(hash_multiset& hs) { _M_ht.swap(hs._M_ht); }
template <class _Val, class _HF, class _EqK, class _Al>
template <class _Val, class _HF, class _EqK, class _Al>
friend bool operator== (const hash_multiset<_Val, _HF, _EqK, _Al>&,
const hash_multiset<_Val, _HF, _EqK, _Al>&);
......@@ -328,15 +328,15 @@ public:
iterator insert(const value_type& __obj)
{ return _M_ht.insert_equal(__obj); }
template <class _InputIterator>
void insert(_InputIterator __f, _InputIterator __l)
void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_equal(__f,__l); }
iterator insert_noresize(const value_type& __obj)
{ return _M_ht.insert_equal_noresize(__obj); }
{ return _M_ht.insert_equal_noresize(__obj); }
iterator find(const key_type& __key) const { return _M_ht.find(__key); }
size_type count(const key_type& __key) const { return _M_ht.count(__key); }
pair<iterator, iterator> equal_range(const key_type& __key) const
{ return _M_ht.equal_range(__key); }
......@@ -354,7 +354,7 @@ public:
};
template <class _Val, class _HashFcn, class _EqualKey, class _Alloc>
inline bool
inline bool
operator==(const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2)
{
......@@ -362,14 +362,14 @@ operator==(const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
}
template <class _Val, class _HashFcn, class _EqualKey, class _Alloc>
inline bool
inline bool
operator!=(const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2) {
return !(__hs1 == __hs2);
}
template <class _Val, class _HashFcn, class _EqualKey, class _Alloc>
inline void
inline void
swap(hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2) {
__hs1.swap(__hs2);
......@@ -399,7 +399,7 @@ public:
insert_iterator(_Container& __x, typename _Container::iterator)
: container(&__x) {}
insert_iterator<_Container>&
operator=(const typename _Container::value_type& __value) {
operator=(const typename _Container::value_type& __value) {
container->insert(__value);
return *this;
}
......@@ -426,7 +426,7 @@ public:
insert_iterator(_Container& __x, typename _Container::iterator)
: container(&__x) {}
insert_iterator<_Container>&
operator=(const typename _Container::value_type& __value) {
operator=(const typename _Container::value_type& __value) {
container->insert(__value);
return *this;
}
......@@ -436,4 +436,4 @@ public:
};
} // namespace std
#endif
#endif
......@@ -72,7 +72,7 @@ namespace __gnu_cxx
// There are two signatures for distance. In addition to the one
// taking two iterators and returning a result, there is another
// taking two iterators and a reference-to-result variable, and
// returning nothing. The latter seems to be an SGI extension.
// returning nothing. The latter seems to be an SGI extension.
// -- pedwards
template<typename _InputIterator, typename _Distance>
inline void
......@@ -86,7 +86,7 @@ namespace __gnu_cxx
template<typename _RandomAccessIterator, typename _Distance>
inline void
__distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
__distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Distance& __n, std::random_access_iterator_tag)
{
// concept requirements
......@@ -109,5 +109,5 @@ namespace __gnu_cxx
}
} // namespace __gnu_cxx
#endif
#endif
......@@ -41,7 +41,7 @@
*/
/** @file ext/debug_allocator.h
* This file is a GNU extension to the Standard C++ Library.
* This file is a GNU extension to the Standard C++ Library.
* You should only include this header if you are using GCC 3 or later.
*/
......@@ -149,7 +149,7 @@ namespace std
/// Versions for the __allocator adaptor used with the predefined
/// "SGI" style allocators.
template<typename _Tp, typename _Tp1, int __inst>
struct _Alloc_traits<_Tp, __allocator<_Tp1,
struct _Alloc_traits<_Tp, __allocator<_Tp1,
__gnu_cxx::__malloc_alloc<__inst> > >
{
static const bool _S_instanceless = true;
......
......@@ -73,30 +73,30 @@ namespace __gnu_cxx
using std::pair;
using std::__iterator_category;
using std::_Temporary_buffer;
template<typename _InputIter, typename _Size, typename _ForwardIter>
pair<_InputIter, _ForwardIter>
__uninitialized_copy_n(_InputIter __first, _Size __count,
_ForwardIter __result, std::input_iterator_tag)
{
_ForwardIter __cur = __result;
try
try
{
for ( ; __count > 0 ; --__count, ++__first, ++__cur)
for ( ; __count > 0 ; --__count, ++__first, ++__cur)
std::_Construct(&*__cur, *__first);
return pair<_InputIter, _ForwardIter>(__first, __cur);
}
catch(...)
{
std::_Destroy(__result, __cur);
__throw_exception_again;
__throw_exception_again;
}
}
template<typename _RandomAccessIter, typename _Size, typename _ForwardIter>
inline pair<_RandomAccessIter, _ForwardIter>
__uninitialized_copy_n(_RandomAccessIter __first, _Size __count,
_ForwardIter __result,
_ForwardIter __result,
std::random_access_iterator_tag)
{
_RandomAccessIter __last = __first + __count;
......@@ -108,7 +108,7 @@ namespace __gnu_cxx
template<typename _InputIter, typename _Size, typename _ForwardIter>
inline pair<_InputIter, _ForwardIter>
__uninitialized_copy_n(_InputIter __first, _Size __count,
_ForwardIter __result)
_ForwardIter __result)
{
return __uninitialized_copy_n(__first, __count, __result,
__iterator_category(__first));
......@@ -127,7 +127,7 @@ namespace __gnu_cxx
template<typename _InputIter, typename _Size, typename _ForwardIter>
inline pair<_InputIter, _ForwardIter>
uninitialized_copy_n(_InputIter __first, _Size __count,
_ForwardIter __result)
_ForwardIter __result)
{
return __uninitialized_copy_n(__first, __count, __result,
__iterator_category(__first));
......@@ -154,7 +154,7 @@ namespace __gnu_cxx
*
* @ingroup SGIextensions
*/
template <class _ForwardIterator, class _Tp
template <class _ForwardIterator, class _Tp
= typename std::iterator_traits<_ForwardIterator>::value_type >
struct temporary_buffer : public _Temporary_buffer<_ForwardIterator, _Tp>
{
......
......@@ -72,7 +72,7 @@
namespace __gnu_cxx
{
// 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>
_Tp
__power(_Tp __x, _Integer __n, _MonoidOperation __monoid_op)
......@@ -131,7 +131,7 @@ namespace __gnu_cxx
*/
// iota is not part of the C++ standard. It is an extension.
template<typename _ForwardIter, typename _Tp>
void
void
iota(_ForwardIter __first, _ForwardIter __last, _Tp __value)
{
// concept requirements
......
......@@ -32,7 +32,7 @@
#ifndef _POD_CHAR_TRAITS_H
#define _POD_CHAR_TRAITS_H 1
#include <string>
namespace __gnu_cxx
......@@ -40,19 +40,19 @@ namespace __gnu_cxx
template<typename V, typename I, typename S = mbstate_t>
struct character
{
typedef V value_type;
typedef I int_type;
typedef S state_type;
value_type value;
typedef V value_type;
typedef I int_type;
typedef S state_type;
value_type value;
};
template<typename V, typename I>
inline bool
inline bool
operator==(const character<V, I>& lhs, const character<V, I>& rhs)
{ return lhs.value == rhs.value; }
template<typename V, typename I>
inline bool
inline bool
operator<(const character<V, I>& lhs, const character<V, I>& rhs)
{ return lhs.value < rhs.value; }
} // namespace __gnu_cxx
......@@ -63,93 +63,93 @@ namespace std
template<typename V, typename I, typename S>
struct char_traits<__gnu_cxx::character<V, I, S> >
{
typedef __gnu_cxx::character<V, I, S> char_type;
typedef __gnu_cxx::character<V, I, S> char_type;
// NB: This type should be bigger than char_type, so as to
// properly hold EOF values in addition to the full range of
// char_type values.
// Also, assumes
// Also, assumes
// int_type(value_type) is valid.
// int_type(-1) is possible.
typedef typename char_type::int_type int_type;
typedef typename char_type::state_type state_type;
typedef fpos<state_type> pos_type;
typedef streamoff off_type;
static void
typedef streamoff off_type;
static void
assign(char_type& __c1, const char_type& __c2)
{ __c1 = __c2; }
static bool
static bool
eq(const char_type& __c1, const char_type& __c2)
{ return __c1 == __c2; }
static bool
static bool
lt(const char_type& __c1, const char_type& __c2)
{ return __c1 < __c2; }
static int
static int
compare(const char_type* __s1, const char_type* __s2, size_t __n)
{
{
for (size_t __i = 0; __i < __n; ++__i)
if (!eq(__s1[__i], __s2[__i]))
return lt(__s1[__i], __s2[__i]) ? -1 : 1;
return 0;
return 0;
}
static size_t
length(const char_type* __s)
{
const char_type* __p = __s;
while (__p->value)
++__p;
return (__p - __s);
{
const char_type* __p = __s;
while (__p->value)
++__p;
return (__p - __s);
}
static const char_type*
static const char_type*
find(const char_type* __s, size_t __n, const char_type& __a)
{
{
for (const char_type* __p = __s; size_t(__p - __s) < __n; ++__p)
if (*__p == __a)
if (*__p == __a)
return __p;
return 0;
}
static char_type*
static char_type*
move(char_type* __s1, const char_type* __s2, size_t __n)
{ return (char_type*) memmove(__s1, __s2, __n * sizeof(char_type)); }
static char_type*
static char_type*
copy(char_type* __s1, const char_type* __s2, size_t __n)
{ return (char_type*) memcpy(__s1, __s2, __n * sizeof(char_type)); }
static char_type*
static char_type*
assign(char_type* __s, size_t __n, char_type __a)
{
for (char_type* __p = __s; __p < __s + __n; ++__p)
{
for (char_type* __p = __s; __p < __s + __n; ++__p)
assign(*__p, __a);
return __s;
return __s;
}
static char_type
static char_type
to_char_type(const int_type& __c)
{
char_type __r = { __c };
return __r;
}
static int_type
to_int_type(const char_type& __c)
static int_type
to_int_type(const char_type& __c)
{ return int_type(__c.value); }
static bool
static bool
eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; }
static int_type
static int_type
eof() { return static_cast<int_type>(-1); }
static int_type
static int_type
not_eof(const int_type& __c)
{ return eq_int_type(__c, eof()) ? int_type(0) : __c; }
};
......
......@@ -41,14 +41,14 @@
*/
/** @file ext/debug_allocator.h
* This file is a GNU extension to the Standard C++ Library.
* This file is a GNU extension to the Standard C++ Library.
* You should only include this header if you are using GCC 3 or later.
*/
#ifndef _POOL_ALLOCATOR_H
#define _POOL_ALLOCATOR_H 1
#include <bits/functexcept.h>
#include <bits/functexcept.h>
#include <bits/stl_threads.h>
#include <bits/atomicity.h>
#include <bits/allocator_traits.h>
......@@ -111,7 +111,7 @@ namespace __gnu_cxx
static size_t _S_heap_size;
static _STL_mutex_lock _S_lock;
static _Atomic_word _S_force_new;
static _Atomic_word _S_force_new;
static size_t
_S_round_up(size_t __bytes)
......@@ -152,7 +152,7 @@ namespace __gnu_cxx
template<bool __threads, int __inst>
inline bool
operator==(const __pool_alloc<__threads,__inst>&,
operator==(const __pool_alloc<__threads,__inst>&,
const __pool_alloc<__threads,__inst>&)
{ return true; }
......@@ -289,7 +289,7 @@ namespace __gnu_cxx
else
__atomic_add(&_S_force_new, -1);
}
if ((__n > (size_t) _S_max_bytes) || (_S_force_new > 0))
__ret = __new_alloc::allocate(__n);
else
......@@ -306,13 +306,13 @@ namespace __gnu_cxx
{
*__free_list = __result -> _M_free_list_link;
__ret = __result;
}
}
if (__builtin_expect(__ret == 0, 0))
__throw_bad_alloc();
}
return __ret;
}
template<bool __threads, int __inst>
void
__pool_alloc<__threads, __inst>::deallocate(void* __p, size_t __n)
......@@ -323,7 +323,7 @@ namespace __gnu_cxx
{
_Obj* volatile* __free_list = _S_free_list + _S_freelist_index(__n);
_Obj* __q = (_Obj*)__p;
// Acquire the lock here with a constructor call. This
// ensures that it is released in exit or during stack
// unwinding.
......@@ -368,9 +368,9 @@ namespace std
template<typename _Tp, bool __thr, int __inst>
struct _Alloc_traits<_Tp, __gnu_cxx::__pool_alloc<__thr, __inst> >
{
static const bool _S_instanceless = true;
typedef __gnu_cxx::__pool_alloc<__thr, __inst> base_alloc_type;
typedef __simple_alloc<_Tp, base_alloc_type> _Alloc_type;
static const bool _S_instanceless = true;
typedef __gnu_cxx::__pool_alloc<__thr, __inst> base_alloc_type;
typedef __simple_alloc<_Tp, base_alloc_type> _Alloc_type;
typedef __allocator<_Tp, base_alloc_type> allocator_type;
};
//@}
......@@ -379,11 +379,11 @@ namespace std
/// Versions for the __allocator adaptor used with the predefined
/// "SGI" style allocators.
template<typename _Tp, typename _Tp1, bool __thr, int __inst>
struct _Alloc_traits<_Tp, __allocator<_Tp1,
struct _Alloc_traits<_Tp, __allocator<_Tp1,
__gnu_cxx::__pool_alloc<__thr, __inst> > >
{
static const bool _S_instanceless = true;
typedef __gnu_cxx::__pool_alloc<__thr, __inst> base_alloc_type;
typedef __gnu_cxx::__pool_alloc<__thr, __inst> base_alloc_type;
typedef __simple_alloc<_Tp, base_alloc_type> _Alloc_type;
typedef __allocator<_Tp, base_alloc_type> allocator_type;
};
......
......@@ -70,7 +70,7 @@ namespace __gnu_cxx
{
using std::_Rb_tree;
using std::allocator;
// Class rb_tree is not part of the C++ standard. It is provided for
// compatibility with the HP STL.
......@@ -85,13 +85,13 @@ namespace __gnu_cxx
{
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
#endif
#endif
......@@ -54,13 +54,13 @@ namespace __gnu_cxx
{
public:
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
typedef _CharT char_type;
typedef _Traits traits_type;
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
typedef std::size_t size_t;
public:
/**
* @param fd An open file descriptor.
......@@ -70,20 +70,20 @@ namespace __gnu_cxx
* This constructor associates a file stream buffer with an open
* POSIX file descriptor.
*/
stdio_filebuf(int __fd, std::ios_base::openmode __mode,
stdio_filebuf(int __fd, std::ios_base::openmode __mode,
size_t __size = static_cast<size_t>(BUFSIZ));
/**
* @param f An open @c FILE*.
* @param mode Same meaning as in a standard filebuf.
* @param size Optimal or preferred size of internal buffer, in chars.
* Defaults to system's @c BUFSIZ.
* Defaults to system's @c BUFSIZ.
*
* This constructor associates a file stream buffer with an open
* C @c FILE*. The @c FILE* will not be automatically closed when the
* stdio_filebuf is closed/destroyed.
*/
stdio_filebuf(std::__c_file* __f, std::ios_base::openmode __mode,
stdio_filebuf(std::__c_file* __f, std::ios_base::openmode __mode,
size_t __size = static_cast<size_t>(BUFSIZ));
/**
......@@ -128,7 +128,7 @@ namespace __gnu_cxx
template<typename _CharT, typename _Traits>
stdio_filebuf<_CharT, _Traits>::
stdio_filebuf(std::__c_file* __f, std::ios_base::openmode __mode,
stdio_filebuf(std::__c_file* __f, std::ios_base::openmode __mode,
size_t __size)
{
this->_M_file.sys_open(__f, __mode);
......@@ -144,4 +144,4 @@ namespace __gnu_cxx
}
} // namespace __gnu_cxx
#endif
#endif
......@@ -61,22 +61,22 @@ namespace __gnu_cxx
{
public:
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
typedef _CharT char_type;
typedef _Traits traits_type;
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
private:
// Underlying stdio FILE
std::__c_file* const _M_file;
// Last character gotten. This is used when pbackfail is
// called from basic_streambuf::sungetc()
int_type _M_unget_buf;
public:
explicit
explicit
stdio_sync_filebuf(std::__c_file* __f)
: _M_file(__f), _M_unget_buf(traits_type::eof())
{ }
......@@ -131,10 +131,10 @@ namespace __gnu_cxx
virtual std::streamsize
xsgetn(char_type* __s, std::streamsize __n);
virtual std::streamsize
showmanyc()
{
{
#if defined(_GLIBCXX_HAVE_S_ISREG) || defined(_GLIBCXX_HAVE_S_IFREG)
// Regular files.
struct stat __buffer;
......@@ -142,7 +142,7 @@ namespace __gnu_cxx
if (!__ret && _GLIBCXX_ISREG(__buffer.st_mode))
return __buffer.st_size - ftell(_M_file);
#endif
return 0;
return 0;
}
virtual int_type
......@@ -183,7 +183,7 @@ namespace __gnu_cxx
#ifdef _GLIBCXX_USE_LFS
if (!fseeko64(_M_file, __off, __whence))
__ret = std::streampos(ftello64(_M_file));
#else
#else
if (!fseek(_M_file, __off, __whence))
__ret = std::streampos(std::ftell(_M_file));
#endif
......@@ -248,7 +248,7 @@ namespace __gnu_cxx
template<>
inline std::streamsize
stdio_sync_filebuf<wchar_t>::xsgetn(wchar_t* __s, std::streamsize __n)
{
{
std::streamsize __ret = 0;
const int_type __eof = traits_type::eof();
while (__n--)
......@@ -266,10 +266,10 @@ namespace __gnu_cxx
_M_unget_buf = traits_type::eof();
return __ret;
}
template<>
inline std::streamsize
stdio_sync_filebuf<wchar_t>::xsputn(const wchar_t* __s,
stdio_sync_filebuf<wchar_t>::xsputn(const wchar_t* __s,
std::streamsize __n)
{
std::streamsize __ret = 0;
......@@ -292,4 +292,4 @@ namespace __gnu_cxx
#endif
} // namespace __gnu_cxx
#endif
#endif
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