Remove trailing whitespace (see ChangeLog for longwinded description).

From-SVN: r77479
This commit is contained in:
Bernardo Innocenti 2004-02-08 05:46:42 +01:00 committed by Bernardo Innocenti
parent f276fb546f
commit ed6814f7b3
65 changed files with 3475 additions and 3439 deletions

View File

@ -1,3 +1,39 @@
2004-02-08 Bernardo Innocenti <bernie@develer.com>
* include/bits/allocator.h, include/bits/basic_ios.h,
include/bits/basic_ios.tcc, include/bits/basic_string.h,
include/bits/basic_string.tcc, include/bits/boost_concept_check.h,
include/bits/char_traits.h, include/bits/codecvt.h,
include/bits/concurrence.h, include/bits/cpp_type_traits.h,
include/bits/demangle.h, include/bits/deque.tcc,
include/bits/fstream.tcc, include/bits/functexcept.h,
include/bits/gslice.h, include/bits/gslice_array.h,
include/bits/indirect_array.h, include/bits/ios_base.h,
include/bits/istream.tcc, include/bits/list.tcc,
include/bits/locale_classes.h, include/bits/locale_facets.h,
include/bits/locale_facets.tcc, include/bits/localefwd.h,
include/bits/mask_array.h, include/bits/ostream.tcc,
include/bits/postypes.h, include/bits/slice_array.h,
include/bits/sstream.tcc, include/bits/stl_algo.h,
include/bits/stl_algobase.h, include/bits/stl_bvector.h,
include/bits/stl_construct.h, include/bits/stl_deque.h,
include/bits/stl_function.h, include/bits/stl_heap.h,
include/bits/stl_iterator.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_list.h, include/bits/stl_map.h,
include/bits/stl_multimap.h, include/bits/stl_multiset.h,
include/bits/stl_numeric.h, include/bits/stl_pair.h,
include/bits/stl_queue.h, include/bits/stl_raw_storage_iter.h,
include/bits/stl_relops.h, include/bits/stl_set.h,
include/bits/stl_stack.h, include/bits/stl_tempbuf.h,
include/bits/stl_threads.h, include/bits/stl_tree.h,
include/bits/stl_uninitialized.h, include/bits/stl_vector.h,
include/bits/stream_iterator.h, include/bits/streambuf.tcc,
include/bits/streambuf_iterator.h,include/bits/stringfwd.h,
include/bits/type_traits.h, include/bits/valarray_after.h,
include/bits/valarray_array.h, include/bits/valarray_array.tcc,
include/bits/valarray_before.h, include/bits/vector.tcc: Remove
trailing whitespace.
2004-02-06 Paolo Carlini <pcarlini@suse.de>
* include/bits/basic_string.h: Fix comment.

View File

@ -84,7 +84,7 @@ namespace std
* (See @link Allocators allocators info @endlink for more.)
*/
template<typename _Tp>
class allocator: public __glibcxx_default_allocator<_Tp>
class allocator: public __glibcxx_default_allocator<_Tp>
{
public:
typedef size_t size_type;
@ -101,7 +101,7 @@ namespace std
allocator() throw() { }
allocator(const allocator& a) throw()
allocator(const allocator& a) throw()
: __glibcxx_default_allocator<_Tp>(a) { }
template<typename _Tp1>

View File

@ -1,6 +1,6 @@
// Iostreams base classes -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003
// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@ -43,7 +43,7 @@
#include <bits/locale_classes.h>
#include <bits/locale_facets.h>
namespace std
namespace std
{
// 27.4.5 Template class basic_ios
/**
@ -76,12 +76,12 @@ namespace std
* @endif
*/
typedef ctype<_CharT> __ctype_type;
typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> >
typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> >
__num_put_type;
typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
__num_get_type;
typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
__num_get_type;
//@}
// Data members:
protected:
basic_ostream<_CharT, _Traits>* _M_tie;
@ -90,7 +90,7 @@ namespace std
basic_streambuf<_CharT, _Traits>* _M_streambuf;
// Cached use_facet<ctype>, which is based on the current locale info.
const __ctype_type* _M_ctype;
const __ctype_type* _M_ctype;
// For ostream.
const __num_put_type* _M_num_put;
// For istream.
@ -104,11 +104,11 @@ namespace std
* This allows you to write constructs such as
* "if (!a_stream) ..." and "while (a_stream) ..."
*/
operator void*() const
operator void*() const
{ return this->fail() ? 0 : const_cast<basic_ios*>(this); }
bool
operator!() const
bool
operator!() const
{ return this->fail(); }
//@}
@ -119,8 +119,8 @@ namespace std
* See std::ios_base::iostate for the possible bit values. Most
* users will call one of the interpreting wrappers, e.g., good().
*/
iostate
rdstate() const
iostate
rdstate() const
{ return _M_streambuf_state; }
/**
@ -130,7 +130,7 @@ namespace std
* See std::ios_base::iostate for the possible bit values. Most
* users will not need to pass an argument.
*/
void
void
clear(iostate __state = goodbit);
/**
@ -139,19 +139,19 @@ namespace std
*
* See std::ios_base::iostate for the possible bit values.
*/
void
setstate(iostate __state)
void
setstate(iostate __state)
{ this->clear(this->rdstate() | __state); }
// Flip the internal state on for the proper state bits, then re
// throws the propagated exception if bit also set in
// exceptions().
void
_M_setstate(iostate __state)
{
_M_setstate(iostate __state)
{
// 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown.
_M_streambuf_state |= __state;
_M_streambuf_state |= __state;
if (this->exceptions() & __state)
__throw_exception_again;
}
@ -162,8 +162,8 @@ namespace std
*
* A wrapper around rdstate.
*/
bool
good() const
bool
good() const
{ return this->rdstate() == 0; }
/**
@ -172,8 +172,8 @@ namespace std
*
* Note that other iostate flags may also be set.
*/
bool
eof() const
bool
eof() const
{ return (this->rdstate() & eofbit) != 0; }
/**
@ -183,8 +183,8 @@ namespace std
* Checking the badbit in fail() is historical practice.
* Note that other iostate flags may also be set.
*/
bool
fail() const
bool
fail() const
{ return (this->rdstate() & (badbit | failbit)) != 0; }
/**
@ -193,8 +193,8 @@ namespace std
*
* Note that other iostate flags may also be set.
*/
bool
bad() const
bool
bad() const
{ return (this->rdstate() & badbit) != 0; }
/**
@ -204,8 +204,8 @@ namespace std
* This changes nothing in the stream. See the one-argument version
* of exceptions(iostate) for the meaning of the return value.
*/
iostate
exceptions() const
iostate
exceptions() const
{ return _M_exception; }
/**
@ -224,26 +224,26 @@ namespace std
* #include <iostream>
* #include <fstream>
* #include <exception>
*
*
* int main()
* {
* std::set_terminate (__gnu_cxx::__verbose_terminate_handler);
*
*
* std::ifstream f ("/etc/motd");
*
*
* std::cerr << "Setting badbit\n";
* f.setstate (std::ios_base::badbit);
*
*
* std::cerr << "Setting exception mask\n";
* f.exceptions (std::ios_base::badbit);
* }
* @endcode
*/
void
exceptions(iostate __except)
{
_M_exception = __except;
this->clear(_M_streambuf_state);
void
exceptions(iostate __except)
{
_M_exception = __except;
this->clear(_M_streambuf_state);
}
// Constructor/destructor:
@ -252,8 +252,8 @@ namespace std
*
* The parameter is passed by derived streams.
*/
explicit
basic_ios(basic_streambuf<_CharT, _Traits>* __sb)
explicit
basic_ios(basic_streambuf<_CharT, _Traits>* __sb)
: ios_base(), _M_ctype(0), _M_num_put(0), _M_num_get(0)
{ this->init(__sb); }
@ -263,9 +263,9 @@ namespace std
* The destructor does nothing. More specifically, it does not
* destroy the streambuf held by rdbuf().
*/
virtual
virtual
~basic_ios() { }
// Members:
/**
* @brief Fetches the current @e tied stream.
@ -277,7 +277,7 @@ namespace std
* first flushed. For example, @c std::cin is tied to @c std::cout.
*/
basic_ostream<_CharT, _Traits>*
tie() const
tie() const
{ return _M_tie; }
/**
@ -303,7 +303,7 @@ namespace std
* This does not change the state of the stream.
*/
basic_streambuf<_CharT, _Traits>*
rdbuf() const
rdbuf() const
{ return _M_streambuf; }
/**
@ -328,7 +328,7 @@ namespace std
* foo.ios::rdbuf(p); // ios == basic_ios<char>
* @endcode
*/
basic_streambuf<_CharT, _Traits>*
basic_streambuf<_CharT, _Traits>*
rdbuf(basic_streambuf<_CharT, _Traits>* __sb);
/**
@ -351,15 +351,15 @@ namespace std
*
* It defaults to a space (' ') in the current locale.
*/
char_type
fill() const
char_type
fill() const
{
if (!_M_fill_init)
{
_M_fill = this->widen(' ');
_M_fill_init = true;
}
return _M_fill;
return _M_fill;
}
/**
@ -371,7 +371,7 @@ namespace std
* have been requested (e.g., via setw), Q characters are actually
* used, and Q<P. It defaults to a space (' ') in the current locale.
*/
char_type
char_type
fill(char_type __ch)
{
char_type __old = this->fill();
@ -391,7 +391,7 @@ namespace std
* Additional l10n notes are at
* http://gcc.gnu.org/onlinedocs/libstdc++/22_locale/howto.html
*/
locale
locale
imbue(const locale& __loc);
/**
@ -411,7 +411,7 @@ namespace std
* Additional l10n notes are at
* http://gcc.gnu.org/onlinedocs/libstdc++/22_locale/howto.html
*/
char
char
narrow(char_type __c, char __dfault) const;
/**
@ -429,9 +429,9 @@ namespace std
* Additional l10n notes are at
* http://gcc.gnu.org/onlinedocs/libstdc++/22_locale/howto.html
*/
char_type
char_type
widen(char __c) const;
protected:
// 27.4.5.1 basic_ios constructors
/**
@ -449,7 +449,7 @@ namespace std
* This is called from the public constructor. It is not virtual and
* cannot be redefined.
*/
void
void
init(basic_streambuf<_CharT, _Traits>* __sb);
void

View File

@ -37,7 +37,7 @@ namespace std
template<typename _CharT, typename _Traits>
void
basic_ios<_CharT, _Traits>::clear(iostate __state)
{
{
if (this->rdbuf())
_M_streambuf_state = __state;
else
@ -45,9 +45,9 @@ namespace std
if (this->exceptions() & this->rdstate())
__throw_ios_failure(__N("basic_ios::clear"));
}
template<typename _CharT, typename _Traits>
basic_streambuf<_CharT, _Traits>*
basic_streambuf<_CharT, _Traits>*
basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<_CharT, _Traits>* __sb)
{
basic_streambuf<_CharT, _Traits>* __old = _M_streambuf;
@ -66,17 +66,17 @@ namespace std
{
// Per 27.1.1, do not call imbue, yet must trash all caches
// associated with imbue()
// Alloc any new word array first, so if it fails we have "rollback".
_Words* __words = (__rhs._M_word_size <= _S_local_word_size) ?
_M_local_word : new _Words[__rhs._M_word_size];
// Bump refs before doing callbacks, for safety.
_Callback_list* __cb = __rhs._M_callbacks;
if (__cb)
if (__cb)
__cb->_M_add_reference();
_M_call_callbacks(erase_event);
if (_M_word != _M_local_word)
if (_M_word != _M_local_word)
{
delete [] _M_word;
_M_word = 0;
@ -84,17 +84,17 @@ namespace std
_M_dispose_callbacks();
// NB: Don't want any added during above.
_M_callbacks = __cb;
_M_callbacks = __cb;
for (int __i = 0; __i < __rhs._M_word_size; ++__i)
__words[__i] = __rhs._M_word[__i];
if (_M_word != _M_local_word)
if (_M_word != _M_local_word)
{
delete [] _M_word;
_M_word = 0;
}
_M_word = __words;
_M_word_size = __rhs._M_word_size;
this->flags(__rhs.flags());
this->width(__rhs.width());
this->precision(__rhs.precision());
@ -102,9 +102,9 @@ namespace std
this->fill(__rhs.fill());
_M_ios_locale = __rhs.getloc();
_M_cache_locale(_M_ios_locale);
_M_call_callbacks(copyfmt_event);
// The next is required to be the last assignment.
this->exceptions(__rhs.exceptions());
}
@ -172,13 +172,13 @@ namespace std
if (__builtin_expect(has_facet<__ctype_type>(__loc), true))
_M_ctype = &use_facet<__ctype_type>(__loc);
if (__builtin_expect(has_facet<__num_put_type>(__loc), true))
_M_num_put = &use_facet<__num_put_type>(__loc);
_M_num_put = &use_facet<__num_put_type>(__loc);
if (__builtin_expect(has_facet<__num_get_type>(__loc), true))
_M_num_get = &use_facet<__num_get_type>(__loc);
_M_num_get = &use_facet<__num_get_type>(__loc);
}
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
// which are defined via explicit instantiations elsewhere.
// NB: This syntax is a GNU extension.
#if _GLIBCXX_EXTERN_TEMPLATE
extern template class basic_ios<char>;
@ -189,4 +189,4 @@ namespace std
#endif
} // namespace std
#endif
#endif

View File

@ -111,20 +111,20 @@ namespace std
{
// Types:
public:
typedef _Traits traits_type;
typedef typename _Traits::char_type value_type;
typedef _Alloc allocator_type;
typedef typename _Alloc::size_type size_type;
typedef typename _Alloc::difference_type difference_type;
typedef typename _Alloc::reference reference;
typedef typename _Alloc::const_reference const_reference;
typedef typename _Alloc::pointer pointer;
typedef typename _Alloc::const_pointer const_pointer;
typedef _Traits traits_type;
typedef typename _Traits::char_type value_type;
typedef _Alloc allocator_type;
typedef typename _Alloc::size_type size_type;
typedef typename _Alloc::difference_type difference_type;
typedef typename _Alloc::reference reference;
typedef typename _Alloc::const_reference const_reference;
typedef typename _Alloc::pointer pointer;
typedef typename _Alloc::const_pointer const_pointer;
typedef __gnu_cxx::__normal_iterator<pointer, basic_string> iterator;
typedef __gnu_cxx::__normal_iterator<const_pointer, basic_string>
const_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
private:
// _Rep: string representation
@ -143,8 +143,8 @@ namespace std
struct _Rep_base
{
size_type _M_length;
size_type _M_capacity;
size_type _M_length;
size_type _M_capacity;
_Atomic_word _M_refcount;
};
@ -166,17 +166,17 @@ namespace std
// Solving for m:
// m = ((npos - sizeof(_Rep))/sizeof(CharT)) - 1
// In addition, this implementation quarters this amount.
static const size_type _S_max_size;
static const _CharT _S_terminal;
static const size_type _S_max_size;
static const _CharT _S_terminal;
// The following storage is init'd to 0 by the linker, resulting
// (carefully) in an empty string with one reference.
static size_type _S_empty_rep_storage[];
static _Rep&
static _Rep&
_S_empty_rep()
{ return *reinterpret_cast<_Rep*>(&_S_empty_rep_storage); }
bool
_M_is_leaked() const
{ return this->_M_refcount < 0; }
@ -246,11 +246,11 @@ namespace std
// size that the allocator can hold.
/// @var
/// Value returned by various member functions when they fail.
static const size_type npos = static_cast<size_type>(-1);
static const size_type npos = static_cast<size_type>(-1);
private:
// Data Members (private):
mutable _Alloc_hider _M_dataplus;
mutable _Alloc_hider _M_dataplus;
_CharT*
_M_data() const
@ -377,7 +377,7 @@ namespace std
* @param s Source character array.
* @param n Number of characters to copy.
* @param a Allocator to use (default is default allocator).
*
*
* NB: s must have at least n characters, '\0' has no special
* meaning.
*/
@ -606,9 +606,9 @@ namespace std
*/
const_reference
operator[] (size_type __pos) const
{
{
_GLIBCXX_DEBUG_ASSERT(__pos <= size());
return _M_data()[__pos];
return _M_data()[__pos];
}
/**
@ -731,9 +731,9 @@ namespace std
*/
basic_string&
append(const _CharT* __s)
{
{
__glibcxx_requires_string(__s);
return this->append(__s, traits_type::length(__s));
return this->append(__s, traits_type::length(__s));
}
/**
@ -819,9 +819,9 @@ namespace std
*/
basic_string&
assign(const _CharT* __s)
{
{
__glibcxx_requires_string(__s);
return this->assign(__s, traits_type::length(__s));
return this->assign(__s, traits_type::length(__s));
}
/**
@ -870,7 +870,7 @@ namespace std
* @brief Insert a range of characters.
* @param p Iterator referencing location in string to insert at.
* @param beg Start of range.
* @param end End of range.
* @param end End of range.
* @throw std::length_error If new length exceeds @c max_size().
*
* Inserts characters in range [beg,end). If adding characters causes
@ -929,7 +929,7 @@ namespace std
* @return Reference to this string.
* @throw std::length_error If new length exceeds @c max_size().
* @throw std::out_of_range If @a pos is beyond the end of this
* string.
* string.
*
* Inserts the first @a n characters of @a s starting at @a pos. If
* adding characters causes the length to exceed max_size(),
@ -957,9 +957,9 @@ namespace std
*/
basic_string&
insert(size_type __pos, const _CharT* __s)
{
{
__glibcxx_requires_string(__s);
return this->insert(__pos, __s, traits_type::length(__s));
return this->insert(__pos, __s, traits_type::length(__s));
}
/**
@ -1002,7 +1002,7 @@ namespace std
const size_type __pos = __p - _M_ibegin();
_M_replace_aux(__pos, size_type(0), size_type(1), __c);
_M_rep()->_M_set_leaked();
return this->_M_ibegin() + __pos;
return this->_M_ibegin() + __pos;
}
/**
@ -1035,7 +1035,7 @@ namespace std
iterator
erase(iterator __position)
{
_GLIBCXX_DEBUG_PEDASSERT(__position >= _M_ibegin()
_GLIBCXX_DEBUG_PEDASSERT(__position >= _M_ibegin()
&& __position < _M_iend());
const size_type __pos = __position - _M_ibegin();
_M_replace_safe(__pos, size_type(1), NULL, size_type(0));
@ -1070,7 +1070,7 @@ namespace std
* @param str String to insert.
* @return Reference to this string.
* @throw std::out_of_range If @a pos is beyond the end of this
* string.
* string.
* @throw std::length_error If new length exceeds @c max_size().
*
* Removes the characters in the range [pos,pos+n) from this string.
@ -1092,7 +1092,7 @@ namespace std
* @param n2 Number of characters from str to use.
* @return Reference to this string.
* @throw std::out_of_range If @a pos1 > size() or @a pos2 >
* str.size().
* str.size().
* @throw std::length_error If new length exceeds @c max_size().
*
* Removes the characters in the range [pos1,pos1 + n) from this
@ -1146,9 +1146,9 @@ namespace std
*/
basic_string&
replace(size_type __pos, size_type __n1, const _CharT* __s)
{
{
__glibcxx_requires_string(__s);
return this->replace(__pos, __n1, __s, traits_type::length(__s));
return this->replace(__pos, __n1, __s, traits_type::length(__s));
}
/**
@ -1207,7 +1207,7 @@ namespace std
replace(iterator __i1, iterator __i2, const _CharT* __s, size_type __n)
{
_GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
&& __i2 <= _M_iend());
&& __i2 <= _M_iend());
return this->replace(__i1 - _M_ibegin(), __i2 - __i1, __s, __n);
}
@ -1226,9 +1226,9 @@ namespace std
*/
basic_string&
replace(iterator __i1, iterator __i2, const _CharT* __s)
{
{
__glibcxx_requires_string(__s);
return this->replace(__i1, __i2, __s, traits_type::length(__s));
return this->replace(__i1, __i2, __s, traits_type::length(__s));
}
/**
@ -1247,10 +1247,10 @@ namespace std
*/
basic_string&
replace(iterator __i1, iterator __i2, size_type __n, _CharT __c)
{
{
_GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
&& __i2 <= _M_iend());
return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __c);
return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __c);
}
/**
@ -1271,40 +1271,40 @@ namespace std
basic_string&
replace(iterator __i1, iterator __i2,
_InputIterator __k1, _InputIterator __k2)
{
{
_GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
&& __i2 <= _M_iend());
__glibcxx_requires_valid_range(__k1, __k2);
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
return _M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral());
return _M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral());
}
// Specializations for the common case of pointer and iterator:
// useful to avoid the overhead of temporary buffering in _M_replace.
basic_string&
replace(iterator __i1, iterator __i2, _CharT* __k1, _CharT* __k2)
{
{
_GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
&& __i2 <= _M_iend());
__glibcxx_requires_valid_range(__k1, __k2);
return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
__k1, __k2 - __k1);
__k1, __k2 - __k1);
}
basic_string&
replace(iterator __i1, iterator __i2,
replace(iterator __i1, iterator __i2,
const _CharT* __k1, const _CharT* __k2)
{
{
_GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
&& __i2 <= _M_iend());
__glibcxx_requires_valid_range(__k1, __k2);
return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
__k1, __k2 - __k1);
__k1, __k2 - __k1);
}
basic_string&
replace(iterator __i1, iterator __i2, iterator __k1, iterator __k2)
{
{
_GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
&& __i2 <= _M_iend());
__glibcxx_requires_valid_range(__k1, __k2);
@ -1313,9 +1313,9 @@ namespace std
}
basic_string&
replace(iterator __i1, iterator __i2,
replace(iterator __i1, iterator __i2,
const_iterator __k1, const_iterator __k2)
{
{
_GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
&& __i2 <= _M_iend());
__glibcxx_requires_valid_range(__k1, __k2);
@ -1326,7 +1326,7 @@ namespace std
private:
template<class _Integer>
basic_string&
_M_replace_dispatch(iterator __i1, iterator __i2, _Integer __n,
_M_replace_dispatch(iterator __i1, iterator __i2, _Integer __n,
_Integer __val, __true_type)
{ return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __val); }
@ -1344,7 +1344,7 @@ namespace std
_M_mutate(__pos1, __n1, __n2);
if (__n2)
traits_type::assign(_M_data() + __pos1, __n2, __c);
return *this;
return *this;
}
basic_string&
@ -1354,7 +1354,7 @@ namespace std
_M_mutate(__pos1, __n1, __n2);
if (__n2)
traits_type::copy(_M_data() + __pos1, __s, __n2);
return *this;
return *this;
}
// _S_construct_aux is used to implement the 21.3.1 para 15 which
@ -1490,9 +1490,9 @@ namespace std
*/
size_type
find(const _CharT* __s, size_type __pos = 0) const
{
{
__glibcxx_requires_string(__s);
return this->find(__s, __pos, traits_type::length(__s));
return this->find(__s, __pos, traits_type::length(__s));
}
/**
@ -1548,9 +1548,9 @@ namespace std
*/
size_type
rfind(const _CharT* __s, size_type __pos = npos) const
{
{
__glibcxx_requires_string(__s);
return this->rfind(__s, __pos, traits_type::length(__s));
return this->rfind(__s, __pos, traits_type::length(__s));
}
/**
@ -1606,9 +1606,9 @@ namespace std
*/
size_type
find_first_of(const _CharT* __s, size_type __pos = 0) const
{
{
__glibcxx_requires_string(__s);
return this->find_first_of(__s, __pos, traits_type::length(__s));
return this->find_first_of(__s, __pos, traits_type::length(__s));
}
/**
@ -1667,9 +1667,9 @@ namespace std
*/
size_type
find_last_of(const _CharT* __s, size_type __pos = npos) const
{
{
__glibcxx_requires_string(__s);
return this->find_last_of(__s, __pos, traits_type::length(__s));
return this->find_last_of(__s, __pos, traits_type::length(__s));
}
/**
@ -1729,9 +1729,9 @@ namespace std
*/
size_type
find_first_not_of(const _CharT* __s, size_type __pos = 0) const
{
{
__glibcxx_requires_string(__s);
return this->find_first_not_of(__s, __pos, traits_type::length(__s));
return this->find_first_not_of(__s, __pos, traits_type::length(__s));
}
/**
@ -1788,9 +1788,9 @@ namespace std
*/
size_type
find_last_not_of(const _CharT* __s, size_type __pos = npos) const
{
{
__glibcxx_requires_string(__s);
return this->find_last_not_of(__s, __pos, traits_type::length(__s));
return this->find_last_not_of(__s, __pos, traits_type::length(__s));
}
/**
@ -1935,7 +1935,7 @@ namespace std
* Returns an integer < 0 if this substring is ordered before the string
* from @a s, 0 if their values are equivalent, or > 0 if this substring
* is ordered after the string from @a s. If the lengths of this
* substring and @a n2 are different, the shorter one is ordered first.
* substring and @a n2 are different, the shorter one is ordered first.
* If they are the same, returns the result of
* traits::compare(substring.data(),s,size());
*
@ -1959,7 +1959,7 @@ namespace std
* @param lhs First string.
* @param rhs Last string.
* @return New string with value of @a lhs followed by @a rhs.
*/
*/
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>
operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
@ -1975,7 +1975,7 @@ namespace std
* @param lhs First string.
* @param rhs Last string.
* @return New string with value of @a lhs followed by @a rhs.
*/
*/
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT,_Traits,_Alloc>
operator+(const _CharT* __lhs,
@ -1986,7 +1986,7 @@ namespace std
* @param lhs First string.
* @param rhs Last string.
* @return New string with @a lhs followed by @a rhs.
*/
*/
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT,_Traits,_Alloc>
operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs);
@ -1996,7 +1996,7 @@ namespace std
* @param lhs First string.
* @param rhs Last string.
* @return New string with @a lhs followed by @a rhs.
*/
*/
template<typename _CharT, typename _Traits, typename _Alloc>
inline basic_string<_CharT, _Traits, _Alloc>
operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
@ -2012,12 +2012,12 @@ namespace std
* @param lhs First string.
* @param rhs Last string.
* @return New string with @a lhs followed by @a rhs.
*/
*/
template<typename _CharT, typename _Traits, typename _Alloc>
inline basic_string<_CharT, _Traits, _Alloc>
operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
{
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
typedef typename __string_type::size_type __size_type;
__string_type __str(__lhs);
__str.append(__size_type(1), __rhs);
@ -2030,7 +2030,7 @@ namespace std
* @param lhs First string.
* @param rhs Second string.
* @return True if @a lhs.compare(@a rhs) == 0. False otherwise.
*/
*/
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
@ -2042,7 +2042,7 @@ namespace std
* @param lhs C string.
* @param rhs String.
* @return True if @a rhs.compare(@a lhs) == 0. False otherwise.
*/
*/
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator==(const _CharT* __lhs,
@ -2054,7 +2054,7 @@ namespace std
* @param lhs String.
* @param rhs C string.
* @return True if @a lhs.compare(@a rhs) == 0. False otherwise.
*/
*/
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
@ -2067,7 +2067,7 @@ namespace std
* @param lhs First string.
* @param rhs Second string.
* @return True if @a lhs.compare(@a rhs) != 0. False otherwise.
*/
*/
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
@ -2079,7 +2079,7 @@ namespace std
* @param lhs C string.
* @param rhs String.
* @return True if @a rhs.compare(@a lhs) != 0. False otherwise.
*/
*/
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator!=(const _CharT* __lhs,
@ -2091,7 +2091,7 @@ namespace std
* @param lhs String.
* @param rhs C string.
* @return True if @a lhs.compare(@a rhs) != 0. False otherwise.
*/
*/
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
@ -2104,7 +2104,7 @@ namespace std
* @param lhs First string.
* @param rhs Second string.
* @return True if @a lhs precedes @a rhs. False otherwise.
*/
*/
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
@ -2116,7 +2116,7 @@ namespace std
* @param lhs String.
* @param rhs C string.
* @return True if @a lhs precedes @a rhs. False otherwise.
*/
*/
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
@ -2128,7 +2128,7 @@ namespace std
* @param lhs C string.
* @param rhs String.
* @return True if @a lhs precedes @a rhs. False otherwise.
*/
*/
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator<(const _CharT* __lhs,
@ -2141,7 +2141,7 @@ namespace std
* @param lhs First string.
* @param rhs Second string.
* @return True if @a lhs follows @a rhs. False otherwise.
*/
*/
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
@ -2153,7 +2153,7 @@ namespace std
* @param lhs String.
* @param rhs C string.
* @return True if @a lhs follows @a rhs. False otherwise.
*/
*/
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
@ -2165,7 +2165,7 @@ namespace std
* @param lhs C string.
* @param rhs String.
* @return True if @a lhs follows @a rhs. False otherwise.
*/
*/
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator>(const _CharT* __lhs,
@ -2178,7 +2178,7 @@ namespace std
* @param lhs First string.
* @param rhs Second string.
* @return True if @a lhs doesn't follow @a rhs. False otherwise.
*/
*/
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
@ -2190,7 +2190,7 @@ namespace std
* @param lhs String.
* @param rhs C string.
* @return True if @a lhs doesn't follow @a rhs. False otherwise.
*/
*/
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
@ -2202,7 +2202,7 @@ namespace std
* @param lhs C string.
* @param rhs String.
* @return True if @a lhs doesn't follow @a rhs. False otherwise.
*/
*/
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator<=(const _CharT* __lhs,
@ -2215,7 +2215,7 @@ namespace std
* @param lhs First string.
* @param rhs Second string.
* @return True if @a lhs doesn't precede @a rhs. False otherwise.
*/
*/
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
@ -2227,7 +2227,7 @@ namespace std
* @param lhs String.
* @param rhs C string.
* @return True if @a lhs doesn't precede @a rhs. False otherwise.
*/
*/
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
@ -2239,7 +2239,7 @@ namespace std
* @param lhs C string.
* @param rhs String.
* @return True if @a lhs doesn't precede @a rhs. False otherwise.
*/
*/
template<typename _CharT, typename _Traits, typename _Alloc>
inline bool
operator>=(const _CharT* __lhs,
@ -2251,7 +2251,7 @@ namespace std
* @param lhs First string.
* @param rhs Second string.
*
* Exchanges the contents of @a lhs and @a rhs in constant time.
* Exchanges the contents of @a lhs and @a rhs in constant time.
*/
template<typename _CharT, typename _Traits, typename _Alloc>
inline void

View File

@ -56,12 +56,12 @@ namespace std
{ return false; }
template<typename _CharT, typename _Traits, typename _Alloc>
const typename basic_string<_CharT, _Traits, _Alloc>::size_type
const typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
_Rep::_S_max_size = (((npos - sizeof(_Rep_base))/sizeof(_CharT)) - 1) / 4;
template<typename _CharT, typename _Traits, typename _Alloc>
const _CharT
const _CharT
basic_string<_CharT, _Traits, _Alloc>::
_Rep::_S_terminal = _CharT();
@ -94,13 +94,13 @@ namespace std
_CharT __buf[100];
size_type __len = 0;
while (__beg != __end && __len < sizeof(__buf) / sizeof(_CharT))
{
__buf[__len++] = *__beg;
{
__buf[__len++] = *__beg;
++__beg;
}
_Rep* __r = _Rep::_S_create(__len, size_type(0), __a);
traits_type::copy(__r->_M_refdata(), __buf, __len);
try
try
{
while (__beg != __end)
{
@ -108,36 +108,36 @@ namespace std
{
// Allocate more space.
_Rep* __another = _Rep::_S_create(__len + 1, __len, __a);
traits_type::copy(__another->_M_refdata(),
traits_type::copy(__another->_M_refdata(),
__r->_M_refdata(), __len);
__r->_M_destroy(__a);
__r = __another;
}
__r->_M_refdata()[__len++] = *__beg;
__r->_M_refdata()[__len++] = *__beg;
++__beg;
}
}
catch(...)
catch(...)
{
__r->_M_destroy(__a);
__r->_M_destroy(__a);
__throw_exception_again;
}
__r->_M_length = __len;
__r->_M_refdata()[__len] = _Rep::_S_terminal; // grrr.
return __r->_M_refdata();
}
template<typename _CharT, typename _Traits, typename _Alloc>
template <typename _InIterator>
_CharT*
basic_string<_CharT, _Traits, _Alloc>::
_S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
_S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a,
forward_iterator_tag)
{
if (__beg == __end && __a == _Alloc())
return _S_empty_rep()._M_refdata();
// NB: Not required, but considered best practice.
// NB: Not required, but considered best practice.
if (__builtin_expect(__is_null_pointer(__beg), 0))
__throw_logic_error(__N("basic_string::_S_construct NULL not valid"));
@ -145,11 +145,11 @@ namespace std
__end));
// Check for out_of_range and length_error exceptions.
_Rep* __r = _Rep::_S_create(__dnew, size_type(0), __a);
try
try
{ _S_copy_chars(__r->_M_refdata(), __beg, __end); }
catch(...)
{
__r->_M_destroy(__a);
catch(...)
{
__r->_M_destroy(__a);
__throw_exception_again;
}
__r->_M_length = __dnew;
@ -167,8 +167,8 @@ namespace std
// Check for out_of_range and length_error exceptions.
_Rep* __r = _Rep::_S_create(__n, size_type(0), __a);
if (__n)
traits_type::assign(__r->_M_refdata(), __n, __c);
if (__n)
traits_type::assign(__r->_M_refdata(), __n, __c);
__r->_M_length = __n;
__r->_M_refdata()[__n] = _Rep::_S_terminal; // grrr
@ -187,7 +187,7 @@ namespace std
basic_string(const _Alloc& __a)
: _M_dataplus(_S_construct(size_type(), _CharT(), __a), __a)
{ }
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::
basic_string(const basic_string& __str, size_type __pos, size_type __n)
@ -230,7 +230,7 @@ namespace std
: _M_dataplus(_S_construct(__n, __c, __a), __a)
{ }
// TBD: DPG annotate
// TBD: DPG annotate
template<typename _CharT, typename _Traits, typename _Alloc>
template<typename _InputIterator>
basic_string<_CharT, _Traits, _Alloc>::
@ -313,7 +313,7 @@ namespace std
return *this;
}
}
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>&
basic_string<_CharT, _Traits, _Alloc>::
@ -350,7 +350,7 @@ namespace std
return _M_replace_safe(__pos, __n1, __tmp._M_data(), __n2);
}
}
template<typename _CharT, typename _Traits, typename _Alloc>
void
basic_string<_CharT, _Traits, _Alloc>::_Rep::
@ -369,7 +369,7 @@ namespace std
{
if (_M_rep() == &_S_empty_rep())
return;
if (_M_rep()->_M_is_shared())
if (_M_rep()->_M_is_shared())
_M_mutate(0, 0, 0);
_M_rep()->_M_set_leaked();
}
@ -383,7 +383,7 @@ namespace std
const size_type __new_size = __old_size + __len2 - __len1;
const _CharT* __src = _M_data() + __pos + __len1;
const size_type __how_much = __old_size - __pos - __len1;
if (_M_rep() == &_S_empty_rep()
|| _M_rep()->_M_is_shared() || __new_size > capacity())
{
@ -410,7 +410,7 @@ namespace std
_M_data()[__new_size] = _Rep::_S_terminal; // grrr. (per 21.3.4)
// You cannot leave those LWG people alone for a second.
}
template<typename _CharT, typename _Traits, typename _Alloc>
void
basic_string<_CharT, _Traits, _Alloc>::reserve(size_type __res)
@ -428,13 +428,13 @@ namespace std
_M_data(__tmp);
}
}
template<typename _CharT, typename _Traits, typename _Alloc>
void basic_string<_CharT, _Traits, _Alloc>::swap(basic_string& __s)
{
if (_M_rep()->_M_is_leaked())
if (_M_rep()->_M_is_leaked())
_M_rep()->_M_set_sharable();
if (__s._M_rep()->_M_is_leaked())
if (__s._M_rep()->_M_is_leaked())
__s._M_rep()->_M_set_sharable();
if (this->get_allocator() == __s.get_allocator())
{
@ -443,11 +443,11 @@ namespace std
__s._M_data(__tmp);
}
// The code below can usually be optimized away.
else
else
{
const basic_string __tmp1(_M_ibegin(), _M_iend(),
__s.get_allocator());
const basic_string __tmp2(__s._M_ibegin(), __s._M_iend(),
const basic_string __tmp2(__s._M_ibegin(), __s._M_iend(),
this->get_allocator());
*this = __tmp2;
__s = __tmp1;
@ -504,7 +504,7 @@ namespace std
const size_type __page_capacity = ((__pagesize - __malloc_header_size
- sizeof(_Rep) - sizeof(_CharT))
/ sizeof(_CharT));
if (__capacity > __old_capacity && __capacity < 2 * __old_capacity
&& __capacity > __page_capacity)
__capacity = 2 * __old_capacity;
@ -558,7 +558,7 @@ namespace std
__r->_M_refdata()[this->_M_length] = _Rep::_S_terminal;
return __r->_M_refdata();
}
template<typename _CharT, typename _Traits, typename _Alloc>
void
basic_string<_CharT, _Traits, _Alloc>::resize(size_type __n, _CharT __c)
@ -577,7 +577,7 @@ namespace std
template<typename _InputIterator>
basic_string<_CharT, _Traits, _Alloc>&
basic_string<_CharT, _Traits, _Alloc>::
_M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
_M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1,
_InputIterator __k2, __false_type)
{
const basic_string __s(__k1, __k2);
@ -720,16 +720,16 @@ namespace std
{
__pos = std::min(size_type(__size - __n), __pos);
const _CharT* __data = _M_data();
do
do
{
if (traits_type::compare(__data + __pos, __s, __n) == 0)
return __pos;
}
}
while (__pos-- > 0);
}
return npos;
}
template<typename _CharT, typename _Traits, typename _Alloc>
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
@ -746,7 +746,7 @@ namespace std
}
return npos;
}
template<typename _CharT, typename _Traits, typename _Alloc>
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
@ -761,7 +761,7 @@ namespace std
}
return npos;
}
template<typename _CharT, typename _Traits, typename _Alloc>
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
@ -770,19 +770,19 @@ namespace std
__glibcxx_requires_string_len(__s, __n);
size_type __size = this->size();
if (__size && __n)
{
if (--__size > __pos)
{
if (--__size > __pos)
__size = __pos;
do
{
if (traits_type::find(__s, __n, _M_data()[__size]))
return __size;
}
}
while (__size-- != 0);
}
return npos;
}
template<typename _CharT, typename _Traits, typename _Alloc>
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
@ -817,11 +817,11 @@ namespace std
{
if (--__size > __pos)
__size = __pos;
do
do
{
if (!traits_type::find(__s, __n, _M_data()[__size]))
return __size;
}
}
while (__size--);
}
return npos;
@ -836,17 +836,17 @@ namespace std
if (__size)
{
if (--__size > __pos)
__size = __pos;
__size = __pos;
do
{
if (!traits_type::eq(_M_data()[__size], __c))
return __size;
}
}
while (__size--);
}
return npos;
}
template<typename _CharT, typename _Traits, typename _Alloc>
int
basic_string<_CharT, _Traits, _Alloc>::
@ -873,7 +873,7 @@ namespace std
__n1 = _M_limit(__pos1, __n1);
__n2 = __str._M_limit(__pos2, __n2);
const size_type __len = std::min(__n1, __n2);
int __r = traits_type::compare(_M_data() + __pos1,
int __r = traits_type::compare(_M_data() + __pos1,
__str.data() + __pos2, __len);
if (!__r)
__r = __n1 - __n2;
@ -914,7 +914,7 @@ namespace std
template<typename _CharT, typename _Traits, typename _Alloc>
int
basic_string <_CharT, _Traits, _Alloc>::
compare(size_type __pos, size_type __n1, const _CharT* __s,
compare(size_type __pos, size_type __n1, const _CharT* __s,
size_type __n2) const
{
__glibcxx_requires_string_len(__s, __n2);
@ -928,36 +928,36 @@ namespace std
}
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
// which are defined via explicit instantiations elsewhere.
// NB: This syntax is a GNU extension.
#if _GLIBCXX_EXTERN_TEMPLATE
extern template class basic_string<char>;
extern template
basic_istream<char>&
extern template
basic_istream<char>&
operator>>(basic_istream<char>&, string&);
extern template
basic_ostream<char>&
extern template
basic_ostream<char>&
operator<<(basic_ostream<char>&, const string&);
extern template
basic_istream<char>&
extern template
basic_istream<char>&
getline(basic_istream<char>&, string&, char);
extern template
basic_istream<char>&
extern template
basic_istream<char>&
getline(basic_istream<char>&, string&);
#ifdef _GLIBCXX_USE_WCHAR_T
extern template class basic_string<wchar_t>;
extern template
basic_istream<wchar_t>&
extern template
basic_istream<wchar_t>&
operator>>(basic_istream<wchar_t>&, wstring&);
extern template
basic_ostream<wchar_t>&
extern template
basic_ostream<wchar_t>&
operator<<(basic_ostream<wchar_t>&, const wstring&);
extern template
basic_istream<wchar_t>&
extern template
basic_istream<wchar_t>&
getline(basic_istream<wchar_t>&, wstring&, wchar_t);
extern template
basic_istream<wchar_t>&
extern template
basic_istream<wchar_t>&
getline(basic_istream<wchar_t>&, wstring&);
#endif
#endif

View File

@ -87,7 +87,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
template <class _Tp>
struct _IntegerConcept {
void __constraints() {
void __constraints() {
this->__error_type_must_be_an_integer_type();
}
};
@ -103,7 +103,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
template <class _Tp>
struct _SignedIntegerConcept {
void __constraints() {
void __constraints() {
this->__error_type_must_be_a_signed_integer_type();
}
};
@ -114,7 +114,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
template <class _Tp>
struct _UnsignedIntegerConcept {
void __constraints() {
void __constraints() {
this->__error_type_must_be_an_unsigned_integer_type();
}
};
@ -312,7 +312,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
template <class _Func, class _Arg>
struct _UnaryFunctionConcept<_Func, void, _Arg> {
void __constraints() {
void __constraints() {
__f(__arg); // require operator()
}
_Func __f;
@ -322,7 +322,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
template <class _Func, class _Return, class _First, class _Second>
struct _BinaryFunctionConcept
{
void __constraints() {
void __constraints() {
__r = __f(__first, __second); // require operator()
}
_Func __f;
@ -366,7 +366,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
// use this when functor is used inside a container class like std::set
template <class _Func, class _First, class _Second>
struct _Const_BinaryPredicateConcept {
void __constraints() {
void __constraints() {
__const_constraints(__f);
}
void __const_constraints(const _Func& __fun) {
@ -560,7 +560,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
typedef typename _Container::reference _Reference;
typedef typename _Container::iterator _Iterator;
typedef typename _Container::pointer _Pointer;
void __constraints() {
__function_requires< _ContainerConcept<_Container> >();
__function_requires< _AssignableConcept<_Value_type> >();
@ -582,7 +582,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
typedef typename _ForwardContainer::const_iterator _Const_iterator;
__function_requires< _ForwardIteratorConcept<_Const_iterator> >();
}
};
};
template <class _ForwardContainer>
struct _Mutable_ForwardContainerConcept
@ -593,7 +593,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
typedef typename _ForwardContainer::iterator _Iterator;
__function_requires< _Mutable_ForwardIteratorConcept<_Iterator> >();
}
};
};
template <class _ReversibleContainer>
struct _ReversibleContainerConcept
@ -693,7 +693,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
__function_requires< _Mutable_ForwardContainerConcept<_Sequence> >();
__function_requires< _DefaultConstructibleConcept<_Sequence> >();
_Sequence
_Sequence
__c(__n) _IsUnused,
__c2(__n, __t) _IsUnused,
__c3(__first, __last) _IsUnused;
@ -758,7 +758,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
__function_requires< _ForwardContainerConcept<_AssociativeContainer> >();
__function_requires<
_DefaultConstructibleConcept<_AssociativeContainer> >();
__i = __c.find(__k);
__r = __c.equal_range(__k);
__c.erase(__k);
@ -789,9 +789,9 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
void __constraints() {
__function_requires<
_AssociativeContainerConcept<_UniqueAssociativeContainer> >();
_UniqueAssociativeContainer __c(__first, __last);
__pos_flag = __c.insert(__t);
__c.insert(__first, __last);
}
@ -808,7 +808,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
_AssociativeContainerConcept<_MultipleAssociativeContainer> >();
_MultipleAssociativeContainer __c(__first, __last);
__pos = __c.insert(__t);
__c.insert(__first, __last);
@ -855,7 +855,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
__function_requires<
_ReversibleContainerConcept<_SortedAssociativeContainer> >();
_SortedAssociativeContainer
_SortedAssociativeContainer
__c(__kc) _IsUnused,
__c2(__first, __last) _IsUnused,
__c3(__first, __last, __kc) _IsUnused;
@ -863,7 +863,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
__p = __c.upper_bound(__k);
__p = __c.lower_bound(__k);
__r = __c.equal_range(__k);
__c.insert(__p, __t);
}
void __const_constraints(const _SortedAssociativeContainer& __c) {

View File

@ -50,12 +50,12 @@ namespace __gnu_cxx
{
/**
* @brief Mapping from character type to associated types.
*
*
*
* @note This is an implementation class for the generic version
* of char_traits. It defines int_type, off_type, pos_type, and
* state_type. By default these are unsigned long, streamoff,
* streampos, and mbstate_t. Users who need a different set of
* streampos, and mbstate_t. Users who need a different set of
* types, but who don't need to change the definitions of any function
* defined in char_traits, can specialize __gnu_cxx::_Char_types
* while leaving __gnu_cxx::char_traits alone. */
@ -91,54 +91,54 @@ namespace __gnu_cxx
typedef typename _Char_types<_CharT>::pos_type pos_type;
typedef typename _Char_types<_CharT>::off_type off_type;
typedef typename _Char_types<_CharT>::state_type state_type;
static void
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, std::size_t __n);
static std::size_t
length(const char_type* __s);
static const char_type*
static const char_type*
find(const char_type* __s, std::size_t __n, const char_type& __a);
static char_type*
static char_type*
move(char_type* __s1, const char_type* __s2, std::size_t __n);
static char_type*
static char_type*
copy(char_type* __s1, const char_type* __s2, std::size_t __n);
static char_type*
static char_type*
assign(char_type* __s, std::size_t __n, char_type __a);
static char_type
static char_type
to_char_type(const int_type& __c)
{ return static_cast<char_type>(__c); }
static int_type
static int_type
to_int_type(const char_type& __c)
{ return static_cast<int_type>(__c); }
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>(EOF); }
static int_type
static int_type
not_eof(const int_type& __c)
{ return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); }
};
@ -168,7 +168,7 @@ namespace __gnu_cxx
}
template<typename _CharT>
const typename char_traits<_CharT>::char_type*
const typename char_traits<_CharT>::char_type*
char_traits<_CharT>::
find(const char_type* __s, std::size_t __n, const char_type& __a)
{
@ -188,7 +188,7 @@ namespace __gnu_cxx
}
template<typename _CharT>
typename char_traits<_CharT>::char_type*
typename char_traits<_CharT>::char_type*
char_traits<_CharT>::
copy(char_type* __s1, const char_type* __s2, std::size_t __n)
{
@ -197,7 +197,7 @@ namespace __gnu_cxx
}
template<typename _CharT>
typename char_traits<_CharT>::char_type*
typename char_traits<_CharT>::char_type*
char_traits<_CharT>::
assign(char_type* __s, std::size_t __n, char_type __a)
{
@ -206,7 +206,7 @@ namespace __gnu_cxx
}
}
namespace std
namespace std
{
// 21.1
/**
@ -237,19 +237,19 @@ namespace std
typedef streamoff off_type;
typedef mbstate_t state_type;
static void
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)
{ return memcmp(__s1, __s2, __n); }
@ -257,40 +257,40 @@ namespace std
length(const char_type* __s)
{ return strlen(__s); }
static const char_type*
static const char_type*
find(const char_type* __s, size_t __n, const char_type& __a)
{ return static_cast<const char_type*>(memchr(__s, __a, __n)); }
static char_type*
static char_type*
move(char_type* __s1, const char_type* __s2, size_t __n)
{ return static_cast<char_type*>(memmove(__s1, __s2, __n)); }
static char_type*
static char_type*
copy(char_type* __s1, const char_type* __s2, size_t __n)
{ return static_cast<char_type*>(memcpy(__s1, __s2, __n)); }
static char_type*
static char_type*
assign(char_type* __s, size_t __n, char_type __a)
{ return static_cast<char_type*>(memset(__s, __a, __n)); }
static char_type
static char_type
to_char_type(const int_type& __c)
{ return static_cast<char_type>(__c); }
// To keep both the byte 0xff and the eof symbol 0xffffffff
// from ending up as 0xffffffff.
static int_type
static int_type
to_int_type(const char_type& __c)
{ return static_cast<int_type>(static_cast<unsigned char>(__c)); }
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>(EOF); }
static int_type
static int_type
not_eof(const int_type& __c)
{ return (__c == eof()) ? 0 : __c; }
};
@ -306,20 +306,20 @@ namespace std
typedef streamoff off_type;
typedef wstreampos pos_type;
typedef mbstate_t state_type;
static void
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)
{ return wmemcmp(__s1, __s2, __n); }
@ -327,36 +327,36 @@ namespace std
length(const char_type* __s)
{ return wcslen(__s); }
static const char_type*
static const char_type*
find(const char_type* __s, size_t __n, const char_type& __a)
{ return wmemchr(__s, __a, __n); }
static char_type*
static char_type*
move(char_type* __s1, const char_type* __s2, size_t __n)
{ return wmemmove(__s1, __s2, __n); }
static char_type*
static char_type*
copy(char_type* __s1, const char_type* __s2, size_t __n)
{ return wmemcpy(__s1, __s2, __n); }
static char_type*
static char_type*
assign(char_type* __s, size_t __n, char_type __a)
{ return wmemset(__s, __a, __n); }
static char_type
static char_type
to_char_type(const int_type& __c) { return char_type(__c); }
static int_type
static int_type
to_int_type(const char_type& __c) { return int_type(__c); }
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>(WEOF); }
static int_type
static int_type
not_eof(const int_type& __c)
{ return eq_int_type(__c, eof()) ? 0 : __c; }
};
@ -368,7 +368,7 @@ namespace std
_CharT _M_c;
_Char_traits_match(_CharT const& __c) : _M_c(__c) { }
bool
bool
operator()(_CharT const& __a) { return _Traits::eq(_M_c, __a); }
};
} // namespace std

View File

@ -71,16 +71,16 @@
* functions.
*/
template<typename _InternT, typename _ExternT, typename _StateT>
class __codecvt_abstract_base
class __codecvt_abstract_base
: public locale::facet, public codecvt_base
{
public:
// Types:
typedef codecvt_base::result result;
typedef _InternT intern_type;
typedef _ExternT extern_type;
typedef _StateT state_type;
typedef _InternT intern_type;
typedef _ExternT extern_type;
typedef _StateT state_type;
// 22.2.1.5.1 codecvt members
/**
* @brief Convert from internal to external character set.
@ -118,13 +118,13 @@
* @return codecvt_base::result.
*/
result
out(state_type& __state, const intern_type* __from,
out(state_type& __state, const intern_type* __from,
const intern_type* __from_end, const intern_type*& __from_next,
extern_type* __to, extern_type* __to_end,
extern_type* __to, extern_type* __to_end,
extern_type*& __to_next) const
{
return this->do_out(__state, __from, __from_end, __from_next,
__to, __to_end, __to_next);
{
return this->do_out(__state, __from, __from_end, __from_next,
__to, __to_end, __to_next);
}
/**
@ -197,20 +197,20 @@
* @return codecvt_base::result.
*/
result
in(state_type& __state, const extern_type* __from,
in(state_type& __state, const extern_type* __from,
const extern_type* __from_end, const extern_type*& __from_next,
intern_type* __to, intern_type* __to_end,
intern_type* __to, intern_type* __to_end,
intern_type*& __to_next) const
{
{
return this->do_in(__state, __from, __from_end, __from_next,
__to, __to_end, __to_next);
__to, __to_end, __to_next);
}
int
int
encoding() const throw()
{ return this->do_encoding(); }
bool
bool
always_noconv() const throw()
{ return this->do_always_noconv(); }
@ -219,15 +219,15 @@
const extern_type* __end, size_t __max) const
{ return this->do_length(__state, __from, __end, __max); }
int
int
max_length() const throw()
{ return this->do_max_length(); }
protected:
explicit
explicit
__codecvt_abstract_base(size_t __refs = 0) : locale::facet(__refs) { }
virtual
virtual
~__codecvt_abstract_base() { }
/**
@ -238,92 +238,92 @@
* the value returned. @see out for more information.
*/
virtual result
do_out(state_type& __state, const intern_type* __from,
do_out(state_type& __state, const intern_type* __from,
const intern_type* __from_end, const intern_type*& __from_next,
extern_type* __to, extern_type* __to_end,
extern_type*& __to_next) const = 0;
virtual result
do_unshift(state_type& __state, extern_type* __to,
do_unshift(state_type& __state, extern_type* __to,
extern_type* __to_end, extern_type*& __to_next) const = 0;
virtual result
do_in(state_type& __state, const extern_type* __from,
const extern_type* __from_end, const extern_type*& __from_next,
intern_type* __to, intern_type* __to_end,
do_in(state_type& __state, const extern_type* __from,
const extern_type* __from_end, const extern_type*& __from_next,
intern_type* __to, intern_type* __to_end,
intern_type*& __to_next) const = 0;
virtual int
virtual int
do_encoding() const throw() = 0;
virtual bool
virtual bool
do_always_noconv() const throw() = 0;
virtual int
do_length(state_type&, const extern_type* __from,
virtual int
do_length(state_type&, const extern_type* __from,
const extern_type* __end, size_t __max) const = 0;
virtual int
virtual int
do_max_length() const throw() = 0;
};
// 22.2.1.5 Template class codecvt
// NB: Generic, mostly useless implementation.
template<typename _InternT, typename _ExternT, typename _StateT>
class codecvt
class codecvt
: public __codecvt_abstract_base<_InternT, _ExternT, _StateT>
{
public:
public:
// Types:
typedef codecvt_base::result result;
typedef _InternT intern_type;
typedef _ExternT extern_type;
typedef _StateT state_type;
typedef _InternT intern_type;
typedef _ExternT extern_type;
typedef _StateT state_type;
protected:
__c_locale _M_c_locale_codecvt;
public:
static locale::id id;
static locale::id id;
explicit
codecvt(size_t __refs = 0)
explicit
codecvt(size_t __refs = 0)
: __codecvt_abstract_base<_InternT, _ExternT, _StateT> (__refs) { }
explicit
explicit
codecvt(__c_locale __cloc, size_t __refs = 0);
protected:
virtual
virtual
~codecvt() { }
virtual result
do_out(state_type& __state, const intern_type* __from,
do_out(state_type& __state, const intern_type* __from,
const intern_type* __from_end, const intern_type*& __from_next,
extern_type* __to, extern_type* __to_end,
extern_type*& __to_next) const;
virtual result
do_unshift(state_type& __state, extern_type* __to,
do_unshift(state_type& __state, extern_type* __to,
extern_type* __to_end, extern_type*& __to_next) const;
virtual result
do_in(state_type& __state, const extern_type* __from,
const extern_type* __from_end, const extern_type*& __from_next,
intern_type* __to, intern_type* __to_end,
do_in(state_type& __state, const extern_type* __from,
const extern_type* __from_end, const extern_type*& __from_next,
intern_type* __to, intern_type* __to_end,
intern_type*& __to_next) const;
virtual int
virtual int
do_encoding() const throw();
virtual bool
virtual bool
do_always_noconv() const throw();
virtual int
do_length(state_type&, const extern_type* __from,
virtual int
do_length(state_type&, const extern_type* __from,
const extern_type* __end, size_t __max) const;
virtual int
virtual int
do_max_length() const throw();
};
@ -332,14 +332,14 @@
// codecvt<char, char, mbstate_t> required specialization
template<>
class codecvt<char, char, mbstate_t>
class codecvt<char, char, mbstate_t>
: public __codecvt_abstract_base<char, char, mbstate_t>
{
public:
public:
// Types:
typedef char intern_type;
typedef char extern_type;
typedef mbstate_t state_type;
typedef char intern_type;
typedef char extern_type;
typedef mbstate_t state_type;
protected:
__c_locale _M_c_locale_codecvt;
@ -347,76 +347,76 @@
public:
static locale::id id;
explicit
explicit
codecvt(size_t __refs = 0);
explicit
explicit
codecvt(__c_locale __cloc, size_t __refs = 0);
protected:
virtual
virtual
~codecvt();
virtual result
do_out(state_type& __state, const intern_type* __from,
do_out(state_type& __state, const intern_type* __from,
const intern_type* __from_end, const intern_type*& __from_next,
extern_type* __to, extern_type* __to_end,
extern_type*& __to_next) const;
virtual result
do_unshift(state_type& __state, extern_type* __to,
do_unshift(state_type& __state, extern_type* __to,
extern_type* __to_end, extern_type*& __to_next) const;
virtual result
do_in(state_type& __state, const extern_type* __from,
do_in(state_type& __state, const extern_type* __from,
const extern_type* __from_end, const extern_type*& __from_next,
intern_type* __to, intern_type* __to_end,
intern_type* __to, intern_type* __to_end,
intern_type*& __to_next) const;
virtual int
virtual int
do_encoding() const throw();
virtual bool
virtual bool
do_always_noconv() const throw();
virtual int
do_length(state_type&, const extern_type* __from,
virtual int
do_length(state_type&, const extern_type* __from,
const extern_type* __end, size_t __max) const;
virtual int
virtual int
do_max_length() const throw();
};
#ifdef _GLIBCXX_USE_WCHAR_T
// codecvt<wchar_t, char, mbstate_t> required specialization
template<>
class codecvt<wchar_t, char, mbstate_t>
class codecvt<wchar_t, char, mbstate_t>
: public __codecvt_abstract_base<wchar_t, char, mbstate_t>
{
public:
// Types:
typedef wchar_t intern_type;
typedef char extern_type;
typedef mbstate_t state_type;
typedef wchar_t intern_type;
typedef char extern_type;
typedef mbstate_t state_type;
protected:
__c_locale _M_c_locale_codecvt;
public:
static locale::id id;
static locale::id id;
explicit
explicit
codecvt(size_t __refs = 0);
explicit
explicit
codecvt(__c_locale __cloc, size_t __refs = 0);
protected:
virtual
virtual
~codecvt();
virtual result
do_out(state_type& __state, const intern_type* __from,
do_out(state_type& __state, const intern_type* __from,
const intern_type* __from_end, const intern_type*& __from_next,
extern_type* __to, extern_type* __to_end,
extern_type*& __to_next) const;
@ -433,17 +433,17 @@
intern_type* __to, intern_type* __to_end,
intern_type*& __to_next) const;
virtual
virtual
int do_encoding() const throw();
virtual
virtual
bool do_always_noconv() const throw();
virtual
virtual
int do_length(state_type&, const extern_type* __from,
const extern_type* __end, size_t __max) const;
virtual int
virtual int
do_max_length() const throw();
};
#endif //_GLIBCXX_USE_WCHAR_T
@ -453,19 +453,19 @@
class codecvt_byname : public codecvt<_InternT, _ExternT, _StateT>
{
public:
explicit
codecvt_byname(const char* __s, size_t __refs = 0)
explicit
codecvt_byname(const char* __s, size_t __refs = 0)
: codecvt<_InternT, _ExternT, _StateT>(__refs)
{
{
if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
{
_S_destroy_c_locale(this->_M_c_locale_codecvt);
_S_create_c_locale(this->_M_c_locale_codecvt, __s);
_S_create_c_locale(this->_M_c_locale_codecvt, __s);
}
}
protected:
virtual
virtual
~codecvt_byname() { }
};

View File

@ -27,7 +27,7 @@
// 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.
#ifndef _CONCURRENCE
#define _CONCURRENCE 1
@ -47,8 +47,8 @@ __GTHREAD_MUTEX_INIT_FUNCTION(&NAME)
# define __glibcxx_mutex_unlock(LOCK) __gthread_mutex_unlock(&LOCK)
#else
# define __glibcxx_mutex_define_initialized(NAME)
# define __glibcxx_mutex_lock(LOCK)
# define __glibcxx_mutex_unlock(LOCK)
# define __glibcxx_mutex_lock(LOCK)
# define __glibcxx_mutex_unlock(LOCK)
#endif
#endif

View File

@ -139,7 +139,7 @@ namespace std
_M_type = 1
};
};
template<>
struct __is_integer<char>
{
@ -157,7 +157,7 @@ namespace std
_M_type = 1
};
};
template<>
struct __is_integer<unsigned char>
{
@ -177,7 +177,7 @@ namespace std
};
};
# endif
template<>
struct __is_integer<short>
{

View File

@ -73,7 +73,7 @@ namespace __gnu_cxx
int M_start_pos;
substitution_nt M_type;
int M_number_of_prefixes;
substitution_st(int start_pos,
substitution_nt type,
int number_of_prefixes)
@ -209,7 +209,7 @@ namespace __gnu_cxx
class qualifier_list
{
typedef typename Allocator::template rebind<char>::other
char_Allocator;
char_Allocator;
typedef std::basic_string<char, std::char_traits<char>, char_Allocator>
string_type;
@ -250,7 +250,7 @@ namespace __gnu_cxx
void
add_qualifier_start(param_qualifier_nt param_qualifier,
int start_pos,
int start_pos,
string_type optional_type,
int inside_substitution)
{ M_qualifier_starts.
@ -259,7 +259,7 @@ namespace __gnu_cxx
void
decode_qualifiers(string_type& prefix,
string_type& postfix,
string_type& postfix,
bool member_function_pointer_qualifiers) const;
bool
@ -307,7 +307,7 @@ namespace __gnu_cxx
// Use (void) instead of (): int f(void)
static unsigned int const style_literal = 2;
// Default behaviour: (long)13,
// Default behaviour: (long)13,
// (unsigned long long)19
// Use extensions 'u', 'l' and 'll' for integral
// literals (as in template arguments): 13l, 19ull
@ -352,7 +352,7 @@ namespace __gnu_cxx
{
friend class qualifier_list<Allocator>;
typedef typename Allocator::template rebind<char>::other
char_Allocator;
char_Allocator;
typedef std::basic_string<char, std::char_traits<char>, char_Allocator>
string_type;
@ -498,7 +498,7 @@ namespace __gnu_cxx
int n = M_substitutions_pos.size() - 1;
if (n > 0)
substitution_name += (n <= 10) ? (char)(n + '0' - 1)
: (char)(n + 'A' - 11);
: (char)(n + 'A' - 11);
substitution_name += '_';
string_type subst;
int saved_pos = M_pos;
@ -1051,56 +1051,56 @@ namespace __gnu_cxx
}
// <operator-name> ::=
// nw # new
// nw # new
// na # new[]
// dl # delete
// da # delete[]
// dl # delete
// da # delete[]
// ps # + (unary)
// ng # - (unary)
// ad # & (unary)
// de # * (unary)
// co # ~
// pl # +
// mi # -
// ml # *
// dv # /
// rm # %
// an # &
// or # |
// eo # ^
// aS # =
// pL # +=
// mI # -=
// mL # *=
// dV # /=
// rM # %=
// aN # &=
// oR # |=
// eO # ^=
// ls # <<
// rs # >>
// lS # <<=
// rS # >>=
// eq # ==
// ne # !=
// lt # <
// gt # >
// le # <=
// ge # >=
// nt # !
// aa # &&
// oo # ||
// pp # ++
// mm # --
// cm # ,
// pm # ->*
// pt # ->
// cl # ()
// ix # []
// ng # - (unary)
// ad # & (unary)
// de # * (unary)
// co # ~
// pl # +
// mi # -
// ml # *
// dv # /
// rm # %
// an # &
// or # |
// eo # ^
// aS # =
// pL # +=
// mI # -=
// mL # *=
// dV # /=
// rM # %=
// aN # &=
// oR # |=
// eO # ^=
// ls # <<
// rs # >>
// lS # <<=
// rS # >>=
// eq # ==
// ne # !=
// lt # <
// gt # >
// le # <=
// ge # >=
// nt # !
// aa # &&
// oo # ||
// pp # ++
// mm # --
// cm # ,
// pm # ->*
// pt # ->
// cl # ()
// ix # []
// qu # ?
// st # sizeof (a type)
// sz # sizeof (an expression)
// cv <type> # (cast)
// cv <type> # (cast)
// v <digit> <source-name> # vendor extended operator
//
// Symbol operator codes exist of two characters, we need to find a
@ -1579,15 +1579,15 @@ namespace __gnu_cxx
// <builtin-type> # Starts with a lower case character != r.
// <function-type> # Starts with F
// <class-enum-type> # Starts with N, S, C, D, Z, a digit or a lower
// # case character. Since a lower case character
// # would be an operator name, that would be an
// # error. The S is a substitution or St
// # (::std::). A 'C' would be a constructor and
// # thus also an error.
// # case character. Since a lower case character
// # would be an operator name, that would be an
// # error. The S is a substitution or St
// # (::std::). A 'C' would be a constructor and
// # thus also an error.
// <template-param> # Starts with T
// <substitution> # Starts with S
// <template-template-param> <template-args> # Starts with T or S,
// # equivalent with the above.
// # equivalent with the above.
//
// <array-type> # Starts with A
// <pointer-to-member-type> # Starts with M
@ -1596,8 +1596,8 @@ namespace __gnu_cxx
// R <type> # reference-to # Starts with R
// C <type> # complex (C 2000) # Starts with C
// G <type> # imaginary (C 2000)# Starts with G
// U <source-name> <type> # vendor extended type qualifier,
// # starts with U
// U <source-name> <type> # vendor extended type qualifier,
// # starts with U
//
// <template-template-param> ::= <template-param>
// ::= <substitution>
@ -1613,9 +1613,9 @@ namespace __gnu_cxx
// <I> is the array index.
// Substitutions:
// <Q>M<C><Q2>F<R><B>E ==> R (C::*Q)B Q2 "<C>", "F<R><B>E"
// (<R> and <B> recursive),
// "M<C><Q2>F<R><B>E".
// <Q>F<R><B>E ==> R (Q)B "<R>", "<B>" (<B> recursive)
// (<R> and <B> recursive),
// "M<C><Q2>F<R><B>E".
// <Q>F<R><B>E ==> R (Q)B "<R>", "<B>" (<B> recursive)
// and "F<R><B>E".
//
// Note that if <R> has postfix qualifiers (an array or function), then
@ -1623,14 +1623,14 @@ namespace __gnu_cxx
// <Q>FPA<R><B>E ==> R (*(Q)B) [], where the PA added the prefix
// "(*" and the postfix ") []".
//
// <Q>G<T> ==> imaginary T Q "<T>", "G<T>" (<T> recursive).
// <Q>C<T> ==> complex T Q "<T>", "C<T>" (<T> recursive).
// <Q><T> ==> T Q "<T>" (<T> recursive).
// <Q>G<T> ==> imaginary T Q "<T>", "G<T>" (<T> recursive).
// <Q>C<T> ==> complex T Q "<T>", "C<T>" (<T> recursive).
// <Q><T> ==> T Q "<T>" (<T> recursive).
//
// where <Q> is any of:
//
// <Q>P ==> *Q "P..."
// <Q>R ==> &Q "R..."
// <Q>P ==> *Q "P..."
// <Q>R ==> &Q "R..."
// <Q>[K|V|r]+ ==> [ const| volatile| restrict]+Q "KVr..."
// <Q>U<S> ==> SQ "U<S>..."
// <Q>M<C> ==> C::*Q "M<C>..." (<C> recurs.)
@ -1641,7 +1641,7 @@ namespace __gnu_cxx
// A<I2>A<I> ==> [I2][I]
// If <Q> ends on [KVr]+, which can happen in combination with
// substitutions only, then special handling is required, see below.
//
//
// A <substitution> is handled with an input position switch during which
// new substitutions are turned off. Because recursive handling of types
// (and therefore the order in which substitutions must be generated) must
@ -1653,7 +1653,7 @@ namespace __gnu_cxx
//
// The following comment was for the demangling of g++ version 3.0.x. The
// mangling (and I believe even the ABI description) have been fixed now
// (as of g++ version 3.1).
// (as of g++ version 3.1).
//
// g++ 3.0.x only:
// The ABI specifies for pointer-to-member function types the format
@ -1696,7 +1696,7 @@ namespace __gnu_cxx
static int const cvq_A = 8; // Saw at least one A
static int const cvq_last = 16; // No remaining qualifiers.
static int const cvq_A_cnt = 32; // Bit 5 and higher represent the
// number of A's in the series.
// number of A's in the series.
// In the function below, iter_array points to the first (right most)
// A in the series, if any.
template<typename Allocator>
@ -2011,9 +2011,9 @@ namespace __gnu_cxx
}
if (!failure)
{
// <Q>G<T> ==> imaginary T Q
// <Q>G<T> ==> imaginary T Q
// substitutions: "<T>", "G<T>" (<T> recursive).
// <Q>C<T> ==> complex T Q
// <Q>C<T> ==> complex T Q
// substitutions: "<T>", "C<T>" (<T> recursive).
if (current() == 'C' || current() == 'G')
{
@ -2034,8 +2034,8 @@ namespace __gnu_cxx
bool extern_C = (next() == 'Y');
if (extern_C)
eat_current();
// <Q>F<R><B>E ==> R (Q)B
// <Q>F<R><B>E ==> R (Q)B
// substitution: "<R>", "<B>" (<B> recursive) and "F<R><B>E".
// Return type.
@ -2143,7 +2143,7 @@ namespace __gnu_cxx
case '7':
case '8':
case '9':
// <Q><T> ==> T Q
// <Q><T> ==> T Q
// substitutions: "<T>" (<T> recursive).
if (!decode_class_enum_type(prefix))
{
@ -2161,7 +2161,7 @@ namespace __gnu_cxx
qualifiers->printing_suppressed();
break;
default:
// <Q><T> ==> T Q
// <Q><T> ==> T Q
// substitutions: "<T>" (<T> recursive).
if (!decode_builtin_type(prefix))
{
@ -2246,7 +2246,7 @@ namespace __gnu_cxx
{
// substitution: "<template-prefix> <template-args>".
add_substitution(substitution_start, nested_name_prefix,
number_of_prefixes);
number_of_prefixes);
}
}
else
@ -2348,7 +2348,7 @@ namespace __gnu_cxx
// <unqualified-name> ::= <operator-name> # Starts with lower case.
// ::= <ctor-dtor-name> # Starts with 'C' or 'D'.
// ::= <source-name> # Starts with a digit.
// ::= <source-name> # Starts with a digit.
//
template<typename Allocator>
bool
@ -2446,8 +2446,8 @@ namespace __gnu_cxx
// <unscoped-template-name> <template-args> # idem
// <local-name> # Starts with 'Z'
// <unscoped-name> # Starts with 'S', 'C', 'D',
// # a digit or a lower case
// # character.
// # a digit or a lower case
// # character.
//
// <unscoped-template-name> ::= <unscoped-name>
// ::= <substitution>
@ -2488,7 +2488,7 @@ namespace __gnu_cxx
// <call-offset> ::= h <nv-offset> _
// ::= v <v-offset> _
// <nv-offset> ::= <offset number>
// <nv-offset> ::= <offset number>
// non-virtual base override
//
// <v-offset> ::= <offset number> _ <virtual offset number>
@ -2538,10 +2538,10 @@ namespace __gnu_cxx
// TS <type> # typeinfo name (null-terminated
// byte string).
// GV <object name> # Guard variable for one-time
// initialization of static objects in
// a local scope.
// initialization of static objects in
// a local scope.
// T <call-offset> <base encoding># base is the nominal target function
// of thunk.
// of thunk.
// Tc <call-offset> <call-offset> <base encoding> # base is the nominal
// target function of thunk; first
// call-offset is 'this' adjustment;
@ -2629,8 +2629,8 @@ namespace __gnu_cxx
// <encoding> ::=
// <function name> <bare-function-type> # Starts with 'C', 'D', 'N',
// 'S', a digit or a lower case
// character.
// 'S', a digit or a lower case
// character.
// <data name> # Idem.
// <special-name> # Starts with 'T' or 'G'.
template<typename Allocator>
@ -2691,7 +2691,7 @@ namespace __gnu_cxx
struct demangle
{
typedef typename Allocator::template rebind<char>::other char_Allocator;
typedef std::basic_string<char, std::char_traits<char>, char_Allocator>
typedef std::basic_string<char, std::char_traits<char>, char_Allocator>
string_type;
static string_type symbol(char const* in,
demangler::implementation_details const& id);
@ -2769,7 +2769,7 @@ namespace __gnu_cxx
|| demangler_session.remaining_input_characters())
{
// Failure to demangle, return the mangled name.
result = input;
result = input;
}
}
return result;

View File

@ -62,7 +62,7 @@
#define _DEQUE_TCC 1
namespace __gnu_norm
{
{
template <typename _Tp, typename _Alloc>
deque<_Tp,_Alloc>&
deque<_Tp,_Alloc>::
@ -82,10 +82,10 @@ namespace __gnu_norm
}
}
return *this;
}
}
template <typename _Tp, typename _Alloc>
typename deque<_Tp,_Alloc>::iterator
typename deque<_Tp,_Alloc>::iterator
deque<_Tp,_Alloc>::
insert(iterator position, const value_type& __x)
{
@ -104,9 +104,9 @@ namespace __gnu_norm
else
return _M_insert_aux(position, __x);
}
template <typename _Tp, typename _Alloc>
typename deque<_Tp,_Alloc>::iterator
typename deque<_Tp,_Alloc>::iterator
deque<_Tp,_Alloc>::
erase(iterator __position)
{
@ -125,9 +125,9 @@ namespace __gnu_norm
}
return this->_M_start + __index;
}
template <typename _Tp, typename _Alloc>
typename deque<_Tp,_Alloc>::iterator
typename deque<_Tp,_Alloc>::iterator
deque<_Tp,_Alloc>::
erase(iterator __first, iterator __last)
{
@ -160,8 +160,8 @@ namespace __gnu_norm
return this->_M_start + __elems_before;
}
}
template <typename _Tp, typename _Alloc>
template <typename _Tp, typename _Alloc>
void
deque<_Tp,_Alloc>::
clear()
@ -173,7 +173,7 @@ namespace __gnu_norm
std::_Destroy(*__node, *__node + _S_buffer_size());
_M_deallocate_node(*__node);
}
if (this->_M_start._M_node != this->_M_finish._M_node)
{
std::_Destroy(this->_M_start._M_cur, this->_M_start._M_last);
@ -182,10 +182,10 @@ namespace __gnu_norm
}
else
std::_Destroy(this->_M_start._M_cur, this->_M_finish._M_cur);
this->_M_finish = this->_M_start;
}
template <typename _Tp, class _Alloc>
template <typename _InputIterator>
void
@ -201,7 +201,7 @@ namespace __gnu_norm
else
insert(end(), __first, __last);
}
template <typename _Tp, typename _Alloc>
void
deque<_Tp,_Alloc>::
@ -232,14 +232,14 @@ namespace __gnu_norm
catch(...)
{
_M_destroy_nodes(this->_M_finish._M_node + 1,
__new_finish._M_node + 1);
__new_finish._M_node + 1);
__throw_exception_again;
}
}
else
else
_M_insert_aux(__pos, __n, __x);
}
template <typename _Tp, typename _Alloc>
void
deque<_Tp,_Alloc>::
@ -262,7 +262,7 @@ namespace __gnu_norm
__throw_exception_again;
}
}
template <typename _Tp, typename _Alloc>
template <typename _InputIterator>
void
@ -282,7 +282,7 @@ namespace __gnu_norm
__throw_exception_again;
}
}
template <typename _Tp, typename _Alloc>
template <typename _ForwardIterator>
void
@ -292,12 +292,12 @@ namespace __gnu_norm
{
const size_type __n = std::distance(__first, __last);
this->_M_initialize_map(__n);
_Map_pointer __cur_node;
try
{
for (__cur_node = this->_M_start._M_node;
__cur_node < this->_M_finish._M_node;
for (__cur_node = this->_M_start._M_node;
__cur_node < this->_M_finish._M_node;
++__cur_node)
{
_ForwardIterator __mid = __first;
@ -313,7 +313,7 @@ namespace __gnu_norm
__throw_exception_again;
}
}
// Called only if _M_finish._M_cur == _M_finish._M_last - 1.
template <typename _Tp, typename _Alloc>
void
@ -335,7 +335,7 @@ namespace __gnu_norm
__throw_exception_again;
}
}
// Called only if _M_start._M_cur == _M_start._M_first.
template <typename _Tp, typename _Alloc>
void
@ -357,8 +357,8 @@ namespace __gnu_norm
_M_deallocate_node(*(this->_M_start._M_node - 1));
__throw_exception_again;
}
}
}
// Called only if _M_finish._M_cur == _M_finish._M_first.
template <typename _Tp, typename _Alloc>
void deque<_Tp,_Alloc>::
@ -369,10 +369,10 @@ namespace __gnu_norm
this->_M_finish._M_cur = this->_M_finish._M_last - 1;
std::_Destroy(this->_M_finish._M_cur);
}
// Called only if _M_start._M_cur == _M_start._M_last - 1. Note that
// if the deque has at least one element (a precondition for this member
// function), and if _M_start._M_cur == _M_start._M_last, then the deque
// Called only if _M_start._M_cur == _M_start._M_last - 1. Note that
// if the deque has at least one element (a precondition for this member
// function), and if _M_start._M_cur == _M_start._M_last, then the deque
// must have at least two nodes.
template <typename _Tp, typename _Alloc>
void deque<_Tp,_Alloc>::
@ -382,8 +382,8 @@ namespace __gnu_norm
_M_deallocate_node(this->_M_start._M_first);
this->_M_start._M_set_node(this->_M_start._M_node + 1);
this->_M_start._M_cur = this->_M_start._M_first;
}
}
template <typename _Tp, typename _Alloc>
template <typename _InputIterator>
void
@ -392,7 +392,7 @@ namespace __gnu_norm
_InputIterator __first, _InputIterator __last,
input_iterator_tag)
{ std::copy(__first, __last, std::inserter(*this, __pos)); }
template <typename _Tp, typename _Alloc>
template <typename _ForwardIterator>
void
@ -434,7 +434,7 @@ namespace __gnu_norm
else
_M_insert_aux(__pos, __first, __last, __n);
}
template <typename _Tp, typename _Alloc>
typename deque<_Tp, _Alloc>::iterator
deque<_Tp,_Alloc>::
@ -467,7 +467,7 @@ namespace __gnu_norm
*__pos = __x_copy;
return __pos;
}
template <typename _Tp, typename _Alloc>
void
deque<_Tp,_Alloc>::
@ -495,14 +495,14 @@ namespace __gnu_norm
else
{
std::__uninitialized_copy_fill(this->_M_start, __pos,
__new_start,
__new_start,
this->_M_start, __x_copy);
this->_M_start = __new_start;
std::fill(__old_start, __pos, __x_copy);
}
}
catch(...)
{
{
_M_destroy_nodes(__new_start._M_node, this->_M_start._M_node);
__throw_exception_again;
}
@ -511,7 +511,7 @@ namespace __gnu_norm
{
iterator __new_finish = _M_reserve_elements_at_back(__n);
iterator __old_finish = this->_M_finish;
const difference_type __elems_after =
const difference_type __elems_after =
difference_type(__length) - __elems_before;
__pos = this->_M_finish - __elems_after;
try
@ -536,14 +536,14 @@ namespace __gnu_norm
}
}
catch(...)
{
{
_M_destroy_nodes(this->_M_finish._M_node + 1,
__new_finish._M_node + 1);
__throw_exception_again;
}
}
}
template <typename _Tp, typename _Alloc>
template <typename _ForwardIterator>
void
@ -563,7 +563,7 @@ namespace __gnu_norm
{
if (__elemsbefore >= difference_type(__n))
{
iterator __start_n = this->_M_start + difference_type(__n);
iterator __start_n = this->_M_start + difference_type(__n);
std::uninitialized_copy(this->_M_start, __start_n,
__new_start);
this->_M_start = __new_start;
@ -590,7 +590,7 @@ namespace __gnu_norm
{
iterator __new_finish = _M_reserve_elements_at_back(__n);
iterator __old_finish = this->_M_finish;
const difference_type __elemsafter =
const difference_type __elemsafter =
difference_type(__length) - __elemsbefore;
__pos = this->_M_finish - __elemsafter;
try
@ -624,7 +624,7 @@ namespace __gnu_norm
}
}
}
template <typename _Tp, typename _Alloc>
void
deque<_Tp,_Alloc>::
@ -642,11 +642,11 @@ namespace __gnu_norm
catch(...)
{
for (size_type __j = 1; __j < __i; ++__j)
_M_deallocate_node(*(this->_M_start._M_node - __j));
_M_deallocate_node(*(this->_M_start._M_node - __j));
__throw_exception_again;
}
}
template <typename _Tp, typename _Alloc>
void
deque<_Tp,_Alloc>::
@ -664,11 +664,11 @@ namespace __gnu_norm
catch(...)
{
for (size_type __j = 1; __j < __i; ++__j)
_M_deallocate_node(*(this->_M_finish._M_node + __j));
_M_deallocate_node(*(this->_M_finish._M_node + __j));
__throw_exception_again;
}
}
template <typename _Tp, typename _Alloc>
void
deque<_Tp,_Alloc>::
@ -677,12 +677,12 @@ namespace __gnu_norm
size_type __old_num_nodes
= this->_M_finish._M_node - this->_M_start._M_node + 1;
size_type __new_num_nodes = __old_num_nodes + __nodes_to_add;
_Map_pointer __new_nstart;
if (this->_M_map_size > 2 * __new_num_nodes)
{
__new_nstart = this->_M_map + (this->_M_map_size
- __new_num_nodes) / 2
- __new_num_nodes) / 2
+ (__add_at_front ? __nodes_to_add : 0);
if (__new_nstart < this->_M_start._M_node)
std::copy(this->_M_start._M_node,
@ -690,7 +690,7 @@ namespace __gnu_norm
__new_nstart);
else
std::copy_backward(this->_M_start._M_node,
this->_M_finish._M_node + 1,
this->_M_finish._M_node + 1,
__new_nstart + __old_num_nodes);
}
else
@ -698,7 +698,7 @@ namespace __gnu_norm
size_type __new_map_size = this->_M_map_size
+ std::max(this->_M_map_size,
__nodes_to_add) + 2;
_Map_pointer __new_map = this->_M_allocate_map(__new_map_size);
__new_nstart = __new_map + (__new_map_size - __new_num_nodes) / 2
+ (__add_at_front ? __nodes_to_add : 0);
@ -706,11 +706,11 @@ namespace __gnu_norm
this->_M_finish._M_node + 1,
__new_nstart);
_M_deallocate_map(this->_M_map, this->_M_map_size);
this->_M_map = __new_map;
this->_M_map_size = __new_map_size;
}
this->_M_start._M_set_node(__new_nstart);
this->_M_finish._M_set_node(__new_nstart + __old_num_nodes - 1);
}

View File

@ -73,20 +73,20 @@ namespace std
template<typename _CharT, typename _Traits>
basic_filebuf<_CharT, _Traits>::
basic_filebuf() : __streambuf_type(), _M_file(&_M_lock),
basic_filebuf() : __streambuf_type(), _M_file(&_M_lock),
_M_mode(ios_base::openmode(0)), _M_state_beg(), _M_state_cur(),
_M_state_last(), _M_buf(NULL), _M_buf_size(BUFSIZ),
_M_buf_allocated(false), _M_reading(false), _M_writing(false),
_M_pback_cur_save(0), _M_pback_end_save(0), _M_pback_init(false),
_M_codecvt(0), _M_ext_buf(0), _M_ext_buf_size(0), _M_ext_next(0),
_M_ext_end(0)
{
{
if (has_facet<__codecvt_type>(this->_M_buf_locale))
_M_codecvt = &use_facet<__codecvt_type>(this->_M_buf_locale);
}
template<typename _CharT, typename _Traits>
typename basic_filebuf<_CharT, _Traits>::__filebuf_type*
typename basic_filebuf<_CharT, _Traits>::__filebuf_type*
basic_filebuf<_CharT, _Traits>::
open(const char* __s, ios_base::openmode __mode)
{
@ -108,8 +108,8 @@ namespace std
_M_state_last = _M_state_cur = _M_state_beg;
// 27.8.1.3,4
if ((__mode & ios_base::ate)
&& this->seekoff(0, ios_base::end, __mode)
if ((__mode & ios_base::ate)
&& this->seekoff(0, ios_base::end, __mode)
== pos_type(off_type(-1)))
this->close();
else
@ -120,7 +120,7 @@ namespace std
}
template<typename _CharT, typename _Traits>
typename basic_filebuf<_CharT, _Traits>::__filebuf_type*
typename basic_filebuf<_CharT, _Traits>::__filebuf_type*
basic_filebuf<_CharT, _Traits>::
close() throw()
{
@ -135,7 +135,7 @@ namespace std
}
catch(...)
{ __testfail = true; }
// NB: Do this here so that re-opened filebufs will be cool...
this->_M_mode = ios_base::openmode(0);
this->_M_pback_init = false;
@ -144,7 +144,7 @@ namespace std
_M_writing = false;
_M_set_buffer(-1);
_M_state_last = _M_state_cur = _M_state_beg;
if (!_M_file.close())
__testfail = true;
@ -155,7 +155,7 @@ namespace std
}
template<typename _CharT, typename _Traits>
streamsize
streamsize
basic_filebuf<_CharT, _Traits>::
showmanyc()
{
@ -173,7 +173,7 @@ namespace std
}
template<typename _CharT, typename _Traits>
typename basic_filebuf<_CharT, _Traits>::int_type
typename basic_filebuf<_CharT, _Traits>::int_type
basic_filebuf<_CharT, _Traits>::
underflow()
{
@ -192,15 +192,15 @@ namespace std
// Get and convert input sequence.
const size_t __buflen = this->_M_buf_size > 1
? this->_M_buf_size - 1 : 1;
// Will be set to true if ::read() returns 0 indicating EOF.
bool __got_eof = false;
// Number of internal characters produced.
streamsize __ilen = 0;
codecvt_base::result __r = codecvt_base::ok;
codecvt_base::result __r = codecvt_base::ok;
if (__check_facet(_M_codecvt).always_noconv())
{
__ilen = _M_file.xsgetn(reinterpret_cast<char*>(this->eback()),
__ilen = _M_file.xsgetn(reinterpret_cast<char*>(this->eback()),
__buflen);
if (__ilen == 0)
__got_eof = true;
@ -226,7 +226,7 @@ namespace std
// chars already present.
if (_M_reading && this->egptr() == this->eback() && __remainder)
__rlen = 0;
// Allocate buffer if necessary and move unconverted
// bytes to front.
if (_M_ext_buf_size < __blen)
@ -269,7 +269,7 @@ namespace std
char_type* __iend;
__r = _M_codecvt->in(_M_state_cur, _M_ext_next,
_M_ext_end, _M_ext_next, this->eback(),
_M_ext_end, _M_ext_next, this->eback(),
this->eback() + __buflen, __iend);
if (__r == codecvt_base::noconv)
{
@ -302,7 +302,7 @@ namespace std
else if (__got_eof)
{
// If the actual end of file is reached, set 'uncommitted'
// mode, thus allowing an immediate write without an
// mode, thus allowing an immediate write without an
// intervening seek.
_M_set_buffer(-1);
_M_reading = false;
@ -317,13 +317,13 @@ namespace std
"invalid byte sequence in file"));
else
__throw_ios_failure(__N("basic_filebuf::underflow "
"error reading the file"));
"error reading the file"));
}
return __ret;
}
template<typename _CharT, typename _Traits>
typename basic_filebuf<_CharT, _Traits>::int_type
typename basic_filebuf<_CharT, _Traits>::int_type
basic_filebuf<_CharT, _Traits>::
pbackfail(int_type __i)
{
@ -333,7 +333,7 @@ namespace std
{
// Remember whether the pback buffer is active, otherwise below
// we may try to store in it a second char (libstdc++/9761).
const bool __testpb = this->_M_pback_init;
const bool __testpb = this->_M_pback_init;
const bool __testeof = traits_type::eq_int_type(__i, __ret);
int_type __tmp;
if (this->eback() < this->gptr())
@ -367,7 +367,7 @@ namespace std
{
_M_create_pback();
_M_reading = true;
*this->gptr() = traits_type::to_char_type(__i);
*this->gptr() = traits_type::to_char_type(__i);
__ret = __i;
}
}
@ -375,7 +375,7 @@ namespace std
}
template<typename _CharT, typename _Traits>
typename basic_filebuf<_CharT, _Traits>::int_type
typename basic_filebuf<_CharT, _Traits>::int_type
basic_filebuf<_CharT, _Traits>::
overflow(int_type __c)
{
@ -392,7 +392,7 @@ namespace std
*this->pptr() = traits_type::to_char_type(__c);
this->pbump(1);
}
// Convert pending sequence to external representation,
// and output.
if (_M_convert_to_external(this->pbase(),
@ -422,7 +422,7 @@ namespace std
// Unbuffered.
char_type __conv = traits_type::to_char_type(__c);
if (__testeof || _M_convert_to_external(&__conv, 1))
{
{
_M_writing = true;
__ret = traits_type::not_eof(__c);
}
@ -430,7 +430,7 @@ namespace std
}
return __ret;
}
template<typename _CharT, typename _Traits>
bool
basic_filebuf<_CharT, _Traits>::
@ -456,7 +456,7 @@ namespace std
codecvt_base::result __r;
__r = _M_codecvt->out(_M_state_cur, __ibuf, __ibuf + __ilen,
__iend, __buf, __buf + __blen, __bend);
if (__r == codecvt_base::ok || __r == codecvt_base::partial)
__blen = __bend - __buf;
else if (__r == codecvt_base::noconv)
@ -470,20 +470,20 @@ namespace std
// Result == error.
__blen = 0;
}
if (__blen)
{
__elen += _M_file.xsputn(__buf, __blen);
__plen += __blen;
}
// Try once more for partial conversions.
if (__r == codecvt_base::partial)
{
const char_type* __iresume = __iend;
streamsize __rlen = this->pptr() - __iend;
__r = _M_codecvt->out(_M_state_cur, __iresume,
__iresume + __rlen, __iend, __buf,
__iresume + __rlen, __iend, __buf,
__buf + __blen, __bend);
if (__r != codecvt_base::error)
{
@ -500,7 +500,7 @@ namespace std
streamsize
basic_filebuf<_CharT, _Traits>::
xsputn(const _CharT* __s, streamsize __n)
{
{
// Optimization in the always_noconv() case, to be generalized in the
// future: when __n is sufficiently large we write directly instead of
// using the buffer.
@ -523,7 +523,7 @@ namespace std
const streamsize __buffill = this->pptr() - this->pbase();
const char* __buf = reinterpret_cast<const char*>(this->pbase());
__ret = _M_file.xsputn_2(__buf, __buffill,
reinterpret_cast<const char*>(__s),
reinterpret_cast<const char*>(__s),
__n);
if (__ret == __buffill + __n)
{
@ -539,12 +539,12 @@ namespace std
__ret = __streambuf_type::xsputn(__s, __n);
}
else
__ret = __streambuf_type::xsputn(__s, __n);
__ret = __streambuf_type::xsputn(__s, __n);
return __ret;
}
template<typename _CharT, typename _Traits>
typename basic_filebuf<_CharT, _Traits>::__streambuf_type*
typename basic_filebuf<_CharT, _Traits>::__streambuf_type*
basic_filebuf<_CharT, _Traits>::
setbuf(char_type* __s, streamsize __n)
{
@ -564,9 +564,9 @@ namespace std
this->_M_buf = __s;
this->_M_buf_size = __n;
}
return this;
return this;
}
// According to 27.8.1.4 p11 - 13, seekoff should ignore the last
// argument (of type openmode).
@ -581,9 +581,9 @@ namespace std
if (__width < 0)
__width = 0;
pos_type __ret = pos_type(off_type(-1));
pos_type __ret = pos_type(off_type(-1));
const bool __testfail = __off != 0 && __width <= 0;
if (this->is_open() && !__testfail)
if (this->is_open() && !__testfail)
{
// Ditch any pback buffers to avoid confusion.
_M_destroy_pback();
@ -608,10 +608,10 @@ namespace std
_M_codecvt->length(_M_state_last, _M_ext_buf, _M_ext_next,
this->gptr() - this->eback());
__computed_off += _M_ext_buf + __gptr_off - _M_ext_end;
// _M_state_last is modified by codecvt::length() so
// it now corresponds to gptr().
__state = _M_state_last;
// it now corresponds to gptr().
__state = _M_state_last;
}
}
__ret = _M_seek(__computed_off, __way, __state);
@ -628,8 +628,8 @@ namespace std
basic_filebuf<_CharT, _Traits>::
seekpos(pos_type __pos, ios_base::openmode)
{
pos_type __ret = pos_type(off_type(-1));
if (this->is_open())
pos_type __ret = pos_type(off_type(-1));
if (this->is_open())
{
// Ditch any pback buffers to avoid confusion.
_M_destroy_pback();
@ -645,9 +645,9 @@ namespace std
{
pos_type __ret = pos_type(off_type(-1));
if (_M_terminate_output())
{
{
// Returns pos_type(off_type(-1)) in case of failure.
__ret = pos_type(_M_file.seekoff(__off, __way));
__ret = pos_type(_M_file.seekoff(__off, __way));
_M_reading = false;
_M_writing = false;
_M_ext_next = _M_ext_end = _M_ext_buf;
@ -671,9 +671,9 @@ namespace std
if (traits_type::eq_int_type(__tmp, traits_type::eof()))
__testvalid = false;
}
// Part two: output unshift sequence.
if (_M_writing && !__check_facet(_M_codecvt).always_noconv()
if (_M_writing && !__check_facet(_M_codecvt).always_noconv()
&& __testvalid)
{
// Note: this value is arbitrary, since there is no way to
@ -694,7 +694,7 @@ namespace std
else if (__r == codecvt_base::ok ||
__r == codecvt_base::partial)
{
__ilen = __next - __buf;
__ilen = __next - __buf;
if (__ilen > 0)
{
const streamsize __elen = _M_file.xsputn(__buf, __ilen);
@ -733,7 +733,7 @@ namespace std
const int_type __tmp = this->overflow();
if (traits_type::eq_int_type(__tmp, traits_type::eof()))
__ret = -1;
}
}
return __ret;
}
@ -745,8 +745,8 @@ namespace std
bool __testvalid = true;
const __codecvt_type* _M_codecvt_tmp = 0;
if (__builtin_expect(has_facet<__codecvt_type>(__loc), true))
_M_codecvt_tmp = &use_facet<__codecvt_type>(__loc);
if (__builtin_expect(has_facet<__codecvt_type>(__loc), true))
_M_codecvt_tmp = &use_facet<__codecvt_type>(__loc);
if (this->is_open())
{
@ -768,7 +768,7 @@ namespace std
else
{
// External position corresponding to gptr().
_M_ext_next = _M_ext_buf
_M_ext_next = _M_ext_buf
+ _M_codecvt->length(_M_state_last, _M_ext_buf, _M_ext_next,
this->gptr() - this->eback());
const streamsize __remainder = _M_ext_end - _M_ext_next;
@ -791,7 +791,7 @@ namespace std
}
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
// which are defined via explicit instantiations elsewhere.
// NB: This syntax is a GNU extension.
#if _GLIBCXX_EXTERN_TEMPLATE
extern template class basic_filebuf<char>;
@ -808,4 +808,4 @@ namespace std
#endif
} // namespace std
#endif
#endif

View File

@ -35,22 +35,22 @@
namespace std
{
// Helper for exception objects in <except>
// Helper for exception objects in <except>
void
__throw_bad_exception(void);
// Helper for exception objects in <new>
// Helper for exception objects in <new>
void
__throw_bad_alloc(void);
// Helper for exception objects in <typeinfo>
// Helper for exception objects in <typeinfo>
void
__throw_bad_cast(void);
void
__throw_bad_typeid(void);
// Helpers for exception objects in <stdexcept>
// Helpers for exception objects in <stdexcept>
void
__throw_logic_error(const char* __s);

View File

@ -41,7 +41,7 @@
#pragma GCC system_header
namespace std {
/**
* @brief Class defining multi-dimensional subset of an array.
*
@ -90,7 +90,7 @@ namespace std {
// XXX: See the note above.
/// Assignment operator.
gslice& operator=(const gslice&);
/// Return array offset of first slice element.
size_t start() const;
@ -99,7 +99,7 @@ namespace std {
/// Return array of array strides for each dimension.
valarray<size_t> stride() const;
private:
struct _Indexer {
size_t _M_count;
@ -114,22 +114,22 @@ namespace std {
};
_Indexer* _M_index;
template<typename _Tp> friend class valarray;
};
inline size_t
gslice::start () const
{ return _M_index ? _M_index->_M_start : 0; }
inline valarray<size_t>
gslice::size () const
{ return _M_index ? _M_index->_M_size : valarray<size_t>(); }
inline valarray<size_t>
gslice::stride () const
{ return _M_index ? _M_index->_M_stride : valarray<size_t>(); }
inline gslice::gslice () : _M_index(0) {}
inline
@ -140,7 +140,7 @@ namespace std {
inline
gslice::gslice(const gslice& __g) : _M_index(__g._M_index)
{ if (_M_index) _M_index->_M_increment_use(); }
inline
gslice::~gslice()
{ if (_M_index && _M_index->_M_decrement_use() == 0) delete _M_index; }
@ -153,8 +153,8 @@ namespace std {
_M_index = __g._M_index;
return *this;
}
} // std::

View File

@ -108,13 +108,13 @@ namespace std {
void operator<<=(const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator>>=(const _Expr<_Dom,_Tp>&) const;
private:
_Array<_Tp> _M_array;
const valarray<size_t>& _M_index;
friend class valarray<_Tp>;
gslice_array(_Array<_Tp>, const valarray<size_t>&);
// this constructor needs to be implemented.
@ -141,13 +141,13 @@ namespace std {
gslice_array<_Tp>::gslice_array(const gslice_array<_Tp>& __a)
: _M_array(__a._M_array), _M_index(__a._M_index) {}
template<typename _Tp>
inline void
gslice_array<_Tp>::operator=(const _Tp& __t) const
{
{
std::__valarray_fill(_M_array, _Array<size_t>(_M_index),
_M_index.size(), __t);
_M_index.size(), __t);
}
template<typename _Tp>
@ -178,8 +178,8 @@ namespace std {
} \
\
template<typename _Tp> \
template<class _Dom> \
inline void \
template<class _Dom> \
inline void \
gslice_array<_Tp>::operator _Op##= (const _Expr<_Dom, _Tp>& __e) const\
{ \
_Array_augmented_##_Name(_M_array, _Array<size_t>(_M_index), __e,\
@ -187,9 +187,9 @@ namespace std {
}
_DEFINE_VALARRAY_OPERATOR(*, __multiplies)
_DEFINE_VALARRAY_OPERATOR(/, __divides)
_DEFINE_VALARRAY_OPERATOR(/, __divides)
_DEFINE_VALARRAY_OPERATOR(%, __modulus)
_DEFINE_VALARRAY_OPERATOR(+, __plus)
_DEFINE_VALARRAY_OPERATOR(+, __plus)
_DEFINE_VALARRAY_OPERATOR(-, __minus)
_DEFINE_VALARRAY_OPERATOR(^, __bitwise_xor)
_DEFINE_VALARRAY_OPERATOR(&, __bitwise_and)

View File

@ -67,7 +67,7 @@ namespace std
/// Assignment operator. Assigns elements to corresponding elements
/// of @a a.
indirect_array& operator=(const indirect_array&);
/// Assign slice elements to corresponding elements of @a v.
void operator=(const valarray<_Tp>&) const;
/// Multiply slice elements by corresponding elements of @a v.
@ -75,11 +75,11 @@ namespace std
/// Divide slice elements by corresponding elements of @a v.
void operator/=(const valarray<_Tp>&) const;
/// Modulo slice elements by corresponding elements of @a v.
void operator%=(const valarray<_Tp>&) const;
void operator%=(const valarray<_Tp>&) const;
/// Add corresponding elements of @a v to slice elements.
void operator+=(const valarray<_Tp>&) const;
/// Subtract corresponding elements of @a v from slice elements.
void operator-=(const valarray<_Tp>&) const;
void operator-=(const valarray<_Tp>&) const;
/// Logical xor slice elements with corresponding elements of @a v.
void operator^=(const valarray<_Tp>&) const;
/// Logical and slice elements with corresponding elements of @a v.
@ -89,11 +89,11 @@ namespace std
/// Left shift slice elements by corresponding elements of @a v.
void operator<<=(const valarray<_Tp>&) const;
/// Right shift slice elements by corresponding elements of @a v.
void operator>>=(const valarray<_Tp>&) const;
void operator>>=(const valarray<_Tp>&) const;
/// Assign all slice elements to @a t.
void operator= (const _Tp&) const;
// ~indirect_array();
template<class _Dom>
void operator=(const _Expr<_Dom, _Tp>&) const;
template<class _Dom>
@ -115,7 +115,7 @@ namespace std
template<class _Dom>
void operator<<=(const _Expr<_Dom, _Tp>&) const;
template<class _Dom>
void operator>>=(const _Expr<_Dom, _Tp>&) const;
void operator>>=(const _Expr<_Dom, _Tp>&) const;
private:
/// Copy constructor. Both slices refer to the same underlying array.
@ -124,23 +124,23 @@ namespace std
friend class valarray<_Tp>;
friend class gslice_array<_Tp>;
const size_t _M_sz;
const size_t _M_sz;
const _Array<size_t> _M_index;
const _Array<_Tp> _M_array;
const _Array<_Tp> _M_array;
// not implemented
indirect_array();
};
template<typename _Tp>
inline
inline
indirect_array<_Tp>::indirect_array(const indirect_array<_Tp>& __a)
: _M_sz(__a._M_sz), _M_index(__a._M_index), _M_array(__a._M_array) {}
template<typename _Tp>
inline
indirect_array<_Tp>::indirect_array(_Array<_Tp> __a, size_t __s,
indirect_array<_Tp>::indirect_array(_Array<_Tp> __a, size_t __s,
_Array<size_t> __i)
: _M_sz(__s), _M_index(__i), _M_array(__a) {}

View File

@ -54,93 +54,93 @@ namespace std
// expressions involving them are no longer compile-time constants.
enum _Ios_Fmtflags { _S_ios_fmtflags_end = 1L << 16 };
inline _Ios_Fmtflags
inline _Ios_Fmtflags
operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
{ return _Ios_Fmtflags(static_cast<int>(__a) & static_cast<int>(__b)); }
inline _Ios_Fmtflags
inline _Ios_Fmtflags
operator|(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
{ return _Ios_Fmtflags(static_cast<int>(__a) | static_cast<int>(__b)); }
inline _Ios_Fmtflags
inline _Ios_Fmtflags
operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
{ return _Ios_Fmtflags(static_cast<int>(__a) ^ static_cast<int>(__b)); }
inline _Ios_Fmtflags
inline _Ios_Fmtflags
operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
{ return __a = __a | __b; }
inline _Ios_Fmtflags
inline _Ios_Fmtflags
operator&=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
{ return __a = __a & __b; }
inline _Ios_Fmtflags
inline _Ios_Fmtflags
operator^=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
{ return __a = __a ^ __b; }
inline _Ios_Fmtflags
inline _Ios_Fmtflags
operator~(_Ios_Fmtflags __a)
{ return _Ios_Fmtflags(~static_cast<int>(__a)); }
enum _Ios_Openmode { _S_ios_openmode_end = 1L << 16 };
inline _Ios_Openmode
inline _Ios_Openmode
operator&(_Ios_Openmode __a, _Ios_Openmode __b)
{ return _Ios_Openmode(static_cast<int>(__a) & static_cast<int>(__b)); }
inline _Ios_Openmode
inline _Ios_Openmode
operator|(_Ios_Openmode __a, _Ios_Openmode __b)
{ return _Ios_Openmode(static_cast<int>(__a) | static_cast<int>(__b)); }
inline _Ios_Openmode
inline _Ios_Openmode
operator^(_Ios_Openmode __a, _Ios_Openmode __b)
{ return _Ios_Openmode(static_cast<int>(__a) ^ static_cast<int>(__b)); }
inline _Ios_Openmode
inline _Ios_Openmode
operator|=(_Ios_Openmode& __a, _Ios_Openmode __b)
{ return __a = __a | __b; }
inline _Ios_Openmode
inline _Ios_Openmode
operator&=(_Ios_Openmode& __a, _Ios_Openmode __b)
{ return __a = __a & __b; }
inline _Ios_Openmode
inline _Ios_Openmode
operator^=(_Ios_Openmode& __a, _Ios_Openmode __b)
{ return __a = __a ^ __b; }
inline _Ios_Openmode
inline _Ios_Openmode
operator~(_Ios_Openmode __a)
{ return _Ios_Openmode(~static_cast<int>(__a)); }
enum _Ios_Iostate { _S_ios_iostate_end = 1L << 16 };
inline _Ios_Iostate
inline _Ios_Iostate
operator&(_Ios_Iostate __a, _Ios_Iostate __b)
{ return _Ios_Iostate(static_cast<int>(__a) & static_cast<int>(__b)); }
inline _Ios_Iostate
inline _Ios_Iostate
operator|(_Ios_Iostate __a, _Ios_Iostate __b)
{ return _Ios_Iostate(static_cast<int>(__a) | static_cast<int>(__b)); }
inline _Ios_Iostate
inline _Ios_Iostate
operator^(_Ios_Iostate __a, _Ios_Iostate __b)
{ return _Ios_Iostate(static_cast<int>(__a) ^ static_cast<int>(__b)); }
inline _Ios_Iostate
inline _Ios_Iostate
operator|=(_Ios_Iostate& __a, _Ios_Iostate __b)
{ return __a = __a | __b; }
inline _Ios_Iostate
inline _Ios_Iostate
operator&=(_Ios_Iostate& __a, _Ios_Iostate __b)
{ return __a = __a & __b; }
inline _Ios_Iostate
inline _Ios_Iostate
operator^=(_Ios_Iostate& __a, _Ios_Iostate __b)
{ return __a = __a ^ __b; }
inline _Ios_Iostate
inline _Ios_Iostate
operator~(_Ios_Iostate __a)
{ return _Ios_Iostate(~static_cast<int>(__a)); }
@ -158,7 +158,7 @@ namespace std
class ios_base
{
public:
// 27.4.2.1.1 Class ios_base::failure
/// These are thrown to indicate problems. Doc me.
class failure : public exception
@ -166,17 +166,17 @@ namespace std
public:
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 48. Use of non-existent exception constructor
explicit
explicit
failure(const string& __str) throw();
// This declaration is not useless:
// http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118
virtual
virtual
~failure() throw();
virtual const char*
what() const throw();
private:
string _M_msg;
};
@ -286,18 +286,18 @@ namespace std
/// Indicates a loss of integrity in an input or output sequence (such
/// as an irrecoverable read error from a file).
static const iostate badbit = iostate(__ios_flags::_S_badbit);
static const iostate badbit = iostate(__ios_flags::_S_badbit);
/// Indicates that an input operation reached the end of an input sequence.
static const iostate eofbit = iostate(__ios_flags::_S_eofbit);
static const iostate eofbit = iostate(__ios_flags::_S_eofbit);
/// Indicates that an input operation failed to read the expected
/// characters, or that an output operation failed to generate the
/// desired characters.
static const iostate failbit = iostate(__ios_flags::_S_failbit);
static const iostate failbit = iostate(__ios_flags::_S_failbit);
/// Indicates all is well.
static const iostate goodbit = iostate(0);
static const iostate goodbit = iostate(0);
// 27.4.2.1.4 Type ios_base::openmode
/**
@ -316,25 +316,25 @@ namespace std
typedef _Ios_Openmode openmode;
/// Seek to end before each write.
static const openmode app = openmode(__ios_flags::_S_app);
static const openmode app = openmode(__ios_flags::_S_app);
/// Open and seek to end immediately after opening.
static const openmode ate = openmode(__ios_flags::_S_ate);
static const openmode ate = openmode(__ios_flags::_S_ate);
/// Perform input and output in binary mode (as opposed to text mode).
/// This is probably not what you think it is; see
/// http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#3 and
/// http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#7 for more.
static const openmode binary = openmode(__ios_flags::_S_bin);
static const openmode binary = openmode(__ios_flags::_S_bin);
/// Open for input. Default for @c ifstream and fstream.
static const openmode in = openmode(__ios_flags::_S_in);
static const openmode in = openmode(__ios_flags::_S_in);
/// Open for output. Default for @c ofstream and fstream.
static const openmode out = openmode(__ios_flags::_S_out);
static const openmode out = openmode(__ios_flags::_S_out);
/// Open for input. Default for @c ofstream.
static const openmode trunc = openmode(__ios_flags::_S_trunc);
static const openmode trunc = openmode(__ios_flags::_S_trunc);
// 27.4.2.1.5 Type ios_base::seekdir
/**
@ -349,20 +349,20 @@ namespace std
typedef _Ios_Seekdir seekdir;
/// Request a seek relative to the beginning of the stream.
static const seekdir beg = seekdir(0);
static const seekdir beg = seekdir(0);
/// Request a seek relative to the current position within the sequence.
static const seekdir cur = seekdir(SEEK_CUR);
static const seekdir cur = seekdir(SEEK_CUR);
/// Request a seek relative to the current end of the sequence.
static const seekdir end = seekdir(SEEK_END);
static const seekdir end = seekdir(SEEK_END);
#ifdef _GLIBCXX_DEPRECATED
// Annex D.6
typedef int io_state;
typedef int open_mode;
typedef int seek_dir;
typedef std::streampos streampos;
typedef std::streamoff streamoff;
#endif
@ -403,7 +403,7 @@ namespace std
* function are allowed. If there are multiple callbacks, they are
* invoked in the order they were registered.
*/
void
void
register_callback(event_callback __fn, int __index);
protected:
@ -413,11 +413,11 @@ namespace std
* ios_base data members (doc me)
* @endif
*/
streamsize _M_precision;
streamsize _M_width;
fmtflags _M_flags;
iostate _M_exception;
iostate _M_streambuf_state;
streamsize _M_precision;
streamsize _M_width;
fmtflags _M_flags;
iostate _M_exception;
iostate _M_streambuf_state;
//@}
// 27.4.2.6 Members for callbacks
@ -425,58 +425,58 @@ namespace std
struct _Callback_list
{
// Data Members
_Callback_list* _M_next;
ios_base::event_callback _M_fn;
int _M_index;
_Callback_list* _M_next;
ios_base::event_callback _M_fn;
int _M_index;
_Atomic_word _M_refcount; // 0 means one reference.
_Callback_list(ios_base::event_callback __fn, int __index,
_Callback_list(ios_base::event_callback __fn, int __index,
_Callback_list* __cb)
: _M_next(__cb), _M_fn(__fn), _M_index(__index), _M_refcount(0) { }
void
void
_M_add_reference() { __atomic_add(&_M_refcount, 1); }
// 0 => OK to delete.
int
int
_M_remove_reference() { return __exchange_and_add(&_M_refcount, -1); }
};
_Callback_list* _M_callbacks;
_Callback_list* _M_callbacks;
void
void
_M_call_callbacks(event __ev) throw();
void
void
_M_dispose_callbacks(void);
// 27.4.2.5 Members for iword/pword storage
struct _Words
{
void* _M_pword;
long _M_iword;
struct _Words
{
void* _M_pword;
long _M_iword;
_Words() : _M_pword(0), _M_iword(0) { }
};
// Only for failed iword/pword calls.
_Words _M_word_zero;
_Words _M_word_zero;
// Guaranteed storage.
// The first 5 iword and pword slots are reserved for internal use.
static const int _S_local_word_size = 8;
_Words _M_local_word[_S_local_word_size];
static const int _S_local_word_size = 8;
_Words _M_local_word[_S_local_word_size];
// Allocated storage.
int _M_word_size;
_Words* _M_word;
_Words&
int _M_word_size;
_Words* _M_word;
_Words&
_M_grow_words(int __index, bool __iword);
// Members for locale and locale caching.
locale _M_ios_locale;
locale _M_ios_locale;
void
void
_M_init();
public:
@ -484,14 +484,14 @@ namespace std
// 27.4.2.1.6 Class ios_base::Init
// Used to initialize standard streams. In theory, g++ could use
// -finit-priority to order this stuff correctly without going
// through these machinations.
class Init
// through these machinations.
class Init
{
friend class ios_base;
public:
Init();
~Init();
private:
static _Atomic_word _S_refcount;
static bool _S_synced_with_stdio;
@ -502,7 +502,7 @@ namespace std
* @brief Access to format flags.
* @return The format control flags for both input and output.
*/
inline fmtflags
inline fmtflags
flags() const { return _M_flags; }
/**
@ -512,12 +512,12 @@ namespace std
*
* This function overwrites all the format flags with @a fmtfl.
*/
inline fmtflags
inline fmtflags
flags(fmtflags __fmtfl)
{
fmtflags __old = _M_flags;
_M_flags = __fmtfl;
return __old;
{
fmtflags __old = _M_flags;
_M_flags = __fmtfl;
return __old;
}
/**
@ -528,12 +528,12 @@ namespace std
* This function sets additional flags in format control. Flags that
* were previously set remain set.
*/
inline fmtflags
inline fmtflags
setf(fmtflags __fmtfl)
{
fmtflags __old = _M_flags;
_M_flags |= __fmtfl;
return __old;
{
fmtflags __old = _M_flags;
_M_flags |= __fmtfl;
return __old;
}
/**
@ -545,7 +545,7 @@ namespace std
* This function clears @a mask in the format flags, then sets
* @a fmtfl @c & @a mask. An example mask is @c ios_base::adjustfield.
*/
inline fmtflags
inline fmtflags
setf(fmtflags __fmtfl, fmtflags __mask)
{
fmtflags __old = _M_flags;
@ -560,7 +560,7 @@ namespace std
*
* This function clears @a mask in the format flags.
*/
inline void
inline void
unsetf(fmtflags __mask) { _M_flags &= ~__mask; }
/**
@ -572,7 +572,7 @@ namespace std
* DR 189.
* @endif
*/
inline streamsize
inline streamsize
precision() const { return _M_precision; }
/**
@ -580,12 +580,12 @@ namespace std
* @param prec The new precision value.
* @return The previous value of precision().
*/
inline streamsize
inline streamsize
precision(streamsize __prec)
{
streamsize __old = _M_precision;
_M_precision = __prec;
return __old;
{
streamsize __old = _M_precision;
_M_precision = __prec;
return __old;
}
/**
@ -594,7 +594,7 @@ namespace std
*
* "Minimum field width" refers to the number of characters.
*/
inline streamsize
inline streamsize
width() const { return _M_width; }
/**
@ -602,12 +602,12 @@ namespace std
* @param wide The new width value.
* @return The previous value of width().
*/
inline streamsize
inline streamsize
width(streamsize __wide)
{
streamsize __old = _M_width;
_M_width = __wide;
return __old;
{
streamsize __old = _M_width;
_M_width = __wide;
return __old;
}
// [27.4.2.4] ios_base static members
@ -621,7 +621,7 @@ namespace std
* cout). User-declared streams are unaffected. See
* http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#8 for more.
*/
static bool
static bool
sync_with_stdio(bool __sync = true);
// [27.4.2.3] ios_base locale functions
@ -633,7 +633,7 @@ namespace std
* Sets the new locale for this stream, and then invokes each callback
* with imbue_event.
*/
locale
locale
imbue(const locale& __loc);
/**
@ -644,7 +644,7 @@ namespace std
* returns @c loc. Otherwise, it returns a copy of @c std::locale(),
* the global C++ locale.
*/
inline locale
inline locale
getloc() const { return _M_ios_locale; }
/**
@ -654,7 +654,7 @@ namespace std
* Like getloc above, but returns a reference instead of
* generating a copy.
*/
inline const locale&
inline const locale&
_M_getloc() const { return _M_ios_locale; }
// [27.4.2.5] ios_base storage functions
@ -672,7 +672,7 @@ namespace std
* returned on each invocation. xalloc is guaranteed to return an index
* that is safe to use in the iword and pword arrays.
*/
static int
static int
xalloc() throw();
/**
@ -688,10 +688,10 @@ namespace std
* obtain an index that is safe to use. Also note that since the array
* can grow dynamically, it is not safe to hold onto the reference.
*/
inline long&
inline long&
iword(int __ix)
{
_Words& __word = (__ix < _M_word_size)
_Words& __word = (__ix < _M_word_size)
? _M_word[__ix] : _M_grow_words(__ix, true);
return __word._M_iword;
}
@ -709,10 +709,10 @@ namespace std
* obtain an index that is safe to use. Also note that since the array
* can grow dynamically, it is not safe to hold onto the reference.
*/
inline void*&
inline void*&
pword(int __ix)
{
_Words& __word = (__ix < _M_word_size)
_Words& __word = (__ix < _M_word_size)
? _M_word[__ix] : _M_grow_words(__ix, false);
return __word._M_pword;
}
@ -736,13 +736,13 @@ namespace std
private:
ios_base(const ios_base&);
ios_base&
ios_base&
operator=(const ios_base&);
};
// [27.4.5.1] fmtflags manipulators
/// Calls base.setf(ios_base::boolalpha).
inline ios_base&
inline ios_base&
boolalpha(ios_base& __base)
{
__base.setf(ios_base::boolalpha);
@ -750,7 +750,7 @@ namespace std
}
/// Calls base.unsetf(ios_base::boolalpha).
inline ios_base&
inline ios_base&
noboolalpha(ios_base& __base)
{
__base.unsetf(ios_base::boolalpha);
@ -758,7 +758,7 @@ namespace std
}
/// Calls base.setf(ios_base::showbase).
inline ios_base&
inline ios_base&
showbase(ios_base& __base)
{
__base.setf(ios_base::showbase);
@ -766,7 +766,7 @@ namespace std
}
/// Calls base.unsetf(ios_base::showbase).
inline ios_base&
inline ios_base&
noshowbase(ios_base& __base)
{
__base.unsetf(ios_base::showbase);
@ -774,7 +774,7 @@ namespace std
}
/// Calls base.setf(ios_base::showpoint).
inline ios_base&
inline ios_base&
showpoint(ios_base& __base)
{
__base.setf(ios_base::showpoint);
@ -782,7 +782,7 @@ namespace std
}
/// Calls base.unsetf(ios_base::showpoint).
inline ios_base&
inline ios_base&
noshowpoint(ios_base& __base)
{
__base.unsetf(ios_base::showpoint);
@ -790,7 +790,7 @@ namespace std
}
/// Calls base.setf(ios_base::showpos).
inline ios_base&
inline ios_base&
showpos(ios_base& __base)
{
__base.setf(ios_base::showpos);
@ -798,7 +798,7 @@ namespace std
}
/// Calls base.unsetf(ios_base::showpos).
inline ios_base&
inline ios_base&
noshowpos(ios_base& __base)
{
__base.unsetf(ios_base::showpos);
@ -806,15 +806,15 @@ namespace std
}
/// Calls base.setf(ios_base::skipws).
inline ios_base&
inline ios_base&
skipws(ios_base& __base)
{
__base.setf(ios_base::skipws);
return __base;
}
/// Calls base.unsetf(ios_base::skipws).
inline ios_base&
inline ios_base&
noskipws(ios_base& __base)
{
__base.unsetf(ios_base::skipws);
@ -822,7 +822,7 @@ namespace std
}
/// Calls base.setf(ios_base::uppercase).
inline ios_base&
inline ios_base&
uppercase(ios_base& __base)
{
__base.setf(ios_base::uppercase);
@ -830,7 +830,7 @@ namespace std
}
/// Calls base.unsetf(ios_base::uppercase).
inline ios_base&
inline ios_base&
nouppercase(ios_base& __base)
{
__base.unsetf(ios_base::uppercase);
@ -838,57 +838,57 @@ namespace std
}
/// Calls base.setf(ios_base::unitbuf).
inline ios_base&
inline ios_base&
unitbuf(ios_base& __base)
{
__base.setf(ios_base::unitbuf);
__base.setf(ios_base::unitbuf);
return __base;
}
/// Calls base.unsetf(ios_base::unitbuf).
inline ios_base&
inline ios_base&
nounitbuf(ios_base& __base)
{
__base.unsetf(ios_base::unitbuf);
return __base;
return __base;
}
// [27.4.5.2] adjustfield anipulators
/// Calls base.setf(ios_base::internal, ios_base::adjustfield).
inline ios_base&
inline ios_base&
internal(ios_base& __base)
{
__base.setf(ios_base::internal, ios_base::adjustfield);
return __base;
return __base;
}
/// Calls base.setf(ios_base::left, ios_base::adjustfield).
inline ios_base&
inline ios_base&
left(ios_base& __base)
{
__base.setf(ios_base::left, ios_base::adjustfield);
return __base;
}
/// Calls base.setf(ios_base::right, ios_base::adjustfield).
inline ios_base&
inline ios_base&
right(ios_base& __base)
{
__base.setf(ios_base::right, ios_base::adjustfield);
return __base;
}
// [27.4.5.3] basefield anipulators
/// Calls base.setf(ios_base::dec, ios_base::basefield).
inline ios_base&
inline ios_base&
dec(ios_base& __base)
{
__base.setf(ios_base::dec, ios_base::basefield);
return __base;
}
/// Calls base.setf(ios_base::hex, ios_base::basefield).
inline ios_base&
inline ios_base&
hex(ios_base& __base)
{
__base.setf(ios_base::hex, ios_base::basefield);
@ -896,16 +896,16 @@ namespace std
}
/// Calls base.setf(ios_base::oct, ios_base::basefield).
inline ios_base&
inline ios_base&
oct(ios_base& __base)
{
__base.setf(ios_base::oct, ios_base::basefield);
return __base;
}
// [27.4.5.4] floatfield anipulators
/// Calls base.setf(ios_base::fixed, ios_base::floatfield).
inline ios_base&
inline ios_base&
fixed(ios_base& __base)
{
__base.setf(ios_base::fixed, ios_base::floatfield);
@ -913,7 +913,7 @@ namespace std
}
/// Calls base.setf(ios_base::scientific, ios_base::floatfield).
inline ios_base&
inline ios_base&
scientific(ios_base& __base)
{
__base.setf(ios_base::scientific, ios_base::floatfield);

View File

@ -40,26 +40,26 @@
#include <locale>
#include <ostream> // For flush()
namespace std
namespace std
{
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>::sentry::
sentry(basic_istream<_CharT, _Traits>& __in, bool __noskipws)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
if (__in.good())
if (__in.good())
{
if (__in.tie())
__in.tie()->flush();
if (!__noskipws && (__in.flags() & ios_base::skipws))
{
{
const __int_type __eof = traits_type::eof();
__streambuf_type* __sb = __in.rdbuf();
__int_type __c = __sb->sgetc();
const __ctype_type& __ct = __check_facet(__in._M_ctype);
while (!traits_type::eq_int_type(__c, __eof)
&& __ct.is(ctype_base::space,
&& __ct.is(ctype_base::space,
traits_type::to_char_type(__c)))
__c = __sb->snextc();
@ -82,39 +82,39 @@ namespace std
}
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(__istream_type& (*__pf)(__istream_type&))
{ return __pf(*this); }
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(__ios_type& (*__pf)(__ios_type&))
{
__pf(*this);
return *this;
}
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(ios_base& (*__pf)(ios_base&))
{
__pf(*this);
return *this;
}
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(bool& __n)
{
sentry __cerb(*this, false);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __n);
@ -128,15 +128,15 @@ namespace std
}
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(short& __n)
{
sentry __cerb(*this, false);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
long __l;
const __num_get_type& __ng = __check_facet(this->_M_num_get);
@ -144,7 +144,7 @@ namespace std
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 118. basic_istream uses nonexistent num_get member functions.
if (!(__err & ios_base::failbit)
&& (numeric_limits<short>::min() <= __l
&& (numeric_limits<short>::min() <= __l
&& __l <= numeric_limits<short>::max()))
__n = __l;
else
@ -159,15 +159,15 @@ namespace std
}
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(unsigned short& __n)
{
sentry __cerb(*this, false);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __n);
@ -181,15 +181,15 @@ namespace std
}
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(int& __n)
{
sentry __cerb(*this, false);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
long __l;
const __num_get_type& __ng = __check_facet(this->_M_num_get);
@ -197,7 +197,7 @@ namespace std
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 118. basic_istream uses nonexistent num_get member functions.
if (!(__err & ios_base::failbit)
&& (numeric_limits<int>::min() <= __l
&& (numeric_limits<int>::min() <= __l
&& __l <= numeric_limits<int>::max()))
__n = __l;
else
@ -212,15 +212,15 @@ namespace std
}
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(unsigned int& __n)
{
sentry __cerb(*this, false);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __n);
@ -234,15 +234,15 @@ namespace std
}
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(long& __n)
{
sentry __cerb(*this, false);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __n);
@ -256,15 +256,15 @@ namespace std
}
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(unsigned long& __n)
{
sentry __cerb(*this, false);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __n);
@ -279,15 +279,15 @@ namespace std
#ifdef _GLIBCXX_USE_LONG_LONG
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(long long& __n)
{
sentry __cerb(*this, false);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __n);
@ -301,15 +301,15 @@ namespace std
}
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(unsigned long long& __n)
{
sentry __cerb(*this, false);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __n);
@ -324,15 +324,15 @@ namespace std
#endif
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(float& __n)
{
sentry __cerb(*this, false);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __n);
@ -346,15 +346,15 @@ namespace std
}
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(double& __n)
{
sentry __cerb(*this, false);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __n);
@ -368,15 +368,15 @@ namespace std
}
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(long double& __n)
{
sentry __cerb(*this, false);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __n);
@ -390,15 +390,15 @@ namespace std
}
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(void*& __n)
{
sentry __cerb(*this, false);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __n);
@ -412,7 +412,7 @@ namespace std
}
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(__streambuf_type* __sbout)
{
@ -445,9 +445,9 @@ namespace std
_M_gcount = 0;
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
sentry __cerb(*this, true);
if (__cerb)
if (__cerb)
{
try
try
{
__c = this->rdbuf()->sbumpc();
// 27.6.1.1 paragraph 3
@ -474,9 +474,9 @@ namespace std
_M_gcount = 0;
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
sentry __cerb(*this, true);
if (__cerb)
if (__cerb)
{
try
try
{
int_type __cb = this->rdbuf()->sbumpc();
// 27.6.1.1 paragraph 3
@ -506,16 +506,16 @@ namespace std
_M_gcount = 0;
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
sentry __cerb(*this, true);
if (__cerb)
if (__cerb)
{
try
try
{
const int_type __idelim = traits_type::to_int_type(__delim);
const int_type __eof = traits_type::eof();
__streambuf_type* __sb = this->rdbuf();
int_type __c = __sb->sgetc();
while (_M_gcount + 1 < __n
int_type __c = __sb->sgetc();
while (_M_gcount + 1 < __n
&& !traits_type::eq_int_type(__c, __eof)
&& !traits_type::eq_int_type(__c, __idelim))
{
@ -545,18 +545,18 @@ namespace std
_M_gcount = 0;
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
sentry __cerb(*this, true);
if (__cerb)
if (__cerb)
{
try
try
{
const int_type __idelim = traits_type::to_int_type(__delim);
const int_type __eof = traits_type::eof();
const int_type __eof = traits_type::eof();
__streambuf_type* __this_sb = this->rdbuf();
int_type __c = __this_sb->sgetc();
char_type __c2 = traits_type::to_char_type(__c);
while (!traits_type::eq_int_type(__c, __eof)
&& !traits_type::eq_int_type(__c, __idelim)
while (!traits_type::eq_int_type(__c, __eof)
&& !traits_type::eq_int_type(__c, __idelim)
&& !traits_type::eq_int_type(__sb.sputc(__c2), __eof))
{
++_M_gcount;
@ -584,16 +584,16 @@ namespace std
_M_gcount = 0;
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
sentry __cerb(*this, true);
if (__cerb)
if (__cerb)
{
try
try
{
const int_type __idelim = traits_type::to_int_type(__delim);
const int_type __eof = traits_type::eof();
__streambuf_type* __sb = this->rdbuf();
int_type __c = __sb->sgetc();
while (_M_gcount + 1 < __n
while (_M_gcount + 1 < __n
&& !traits_type::eq_int_type(__c, __eof)
&& !traits_type::eq_int_type(__c, __idelim))
{
@ -624,7 +624,7 @@ namespace std
this->setstate(__err);
return *this;
}
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
@ -632,17 +632,17 @@ namespace std
{
_M_gcount = 0;
sentry __cerb(*this, true);
if (__cerb && __n > 0)
if (__cerb && __n > 0)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
const int_type __eof = traits_type::eof();
__streambuf_type* __sb = this->rdbuf();
int_type __c;
__n = std::min(__n, numeric_limits<streamsize>::max());
while (_M_gcount < __n
while (_M_gcount < __n
&& !traits_type::eq_int_type(__c = __sb->sbumpc(), __eof))
{
++_M_gcount;
@ -659,7 +659,7 @@ namespace std
}
return *this;
}
template<typename _CharT, typename _Traits>
typename basic_istream<_CharT, _Traits>::int_type
basic_istream<_CharT, _Traits>::
@ -671,7 +671,7 @@ namespace std
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
__c = this->rdbuf()->sgetc();
if (traits_type::eq_int_type(__c, traits_type::eof()))
@ -681,7 +681,7 @@ namespace std
{ this->_M_setstate(ios_base::badbit); }
if (__err)
this->setstate(__err);
}
}
return __c;
}
@ -692,15 +692,15 @@ namespace std
{
_M_gcount = 0;
sentry __cerb(*this, true);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
_M_gcount = this->rdbuf()->sgetn(__s, __n);
if (_M_gcount != __n)
__err |= (ios_base::eofbit | ios_base::failbit);
}
}
catch(...)
{ this->_M_setstate(ios_base::badbit); }
if (__err)
@ -708,18 +708,18 @@ namespace std
}
return *this;
}
template<typename _CharT, typename _Traits>
streamsize
streamsize
basic_istream<_CharT, _Traits>::
readsome(char_type* __s, streamsize __n)
{
_M_gcount = 0;
sentry __cerb(*this, true);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
// Cannot compare int_type with streamsize generically.
streamsize __num = this->rdbuf()->in_avail();
@ -739,7 +739,7 @@ namespace std
}
return _M_gcount;
}
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
@ -749,14 +749,14 @@ namespace std
// 60. What is a formatted input function?
_M_gcount = 0;
sentry __cerb(*this, true);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
const int_type __eof = traits_type::eof();
__streambuf_type* __sb = this->rdbuf();
if (!__sb
if (!__sb
|| traits_type::eq_int_type(__sb->sputbackc(__c), __eof))
__err |= ios_base::badbit;
}
@ -767,7 +767,7 @@ namespace std
}
return *this;
}
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
@ -777,14 +777,14 @@ namespace std
// 60. What is a formatted input function?
_M_gcount = 0;
sentry __cerb(*this, true);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
const int_type __eof = traits_type::eof();
__streambuf_type* __sb = this->rdbuf();
if (!__sb
if (!__sb
|| traits_type::eq_int_type(__sb->sungetc(), __eof))
__err |= ios_base::badbit;
}
@ -795,7 +795,7 @@ namespace std
}
return *this;
}
template<typename _CharT, typename _Traits>
int
basic_istream<_CharT, _Traits>::
@ -805,17 +805,17 @@ namespace std
// DR60. Do not change _M_gcount.
int __ret = -1;
sentry __cerb(*this, true);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
__streambuf_type* __sb = this->rdbuf();
if (__sb)
{
if (__sb->pubsync() == -1)
__err |= ios_base::badbit;
else
else
__ret = 0;
}
}
@ -826,7 +826,7 @@ namespace std
}
return __ret;
}
template<typename _CharT, typename _Traits>
typename basic_istream<_CharT, _Traits>::pos_type
basic_istream<_CharT, _Traits>::
@ -885,9 +885,9 @@ namespace std
if (!this->fail())
{
// 136. seekp, seekg setting wrong streams?
pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
ios_base::in);
// 129. Need error indication from seekp() and seekg()
if (__p == pos_type(off_type(-1)))
__err |= ios_base::failbit;
@ -905,12 +905,12 @@ namespace std
basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
{
typedef basic_istream<_CharT, _Traits> __istream_type;
typedef basic_istream<_CharT, _Traits> __istream_type;
typename __istream_type::sentry __cerb(__in, false);
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
typename __istream_type::int_type __cb = __in.rdbuf()->sbumpc();
if (!_Traits::eq_int_type(__cb, _Traits::eof()))
@ -930,33 +930,33 @@ namespace std
basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
{
typedef basic_istream<_CharT, _Traits> __istream_type;
typedef basic_istream<_CharT, _Traits> __istream_type;
typedef typename __istream_type::__streambuf_type __streambuf_type;
typedef typename _Traits::int_type int_type;
typedef _CharT char_type;
typedef ctype<_CharT> __ctype_type;
typedef typename _Traits::int_type int_type;
typedef _CharT char_type;
typedef ctype<_CharT> __ctype_type;
streamsize __extracted = 0;
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
typename __istream_type::sentry __cerb(__in, false);
if (__cerb)
{
try
try
{
// Figure out how many characters to extract.
streamsize __num = __in.width();
if (__num <= 0)
__num = numeric_limits<streamsize>::max();
const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
const int_type __eof = _Traits::eof();
__streambuf_type* __sb = __in.rdbuf();
int_type __c = __sb->sgetc();
while (__extracted < __num - 1
while (__extracted < __num - 1
&& !_Traits::eq_int_type(__c, __eof)
&& !__ct.is(ctype_base::space,
&& !__ct.is(ctype_base::space,
_Traits::to_char_type(__c)))
{
*__s++ = _Traits::to_char_type(__c);
@ -983,20 +983,20 @@ namespace std
// 27.6.1.4 Standard basic_istream manipulators
template<typename _CharT, typename _Traits>
basic_istream<_CharT,_Traits>&
basic_istream<_CharT,_Traits>&
ws(basic_istream<_CharT,_Traits>& __in)
{
typedef basic_istream<_CharT, _Traits> __istream_type;
typedef basic_istream<_CharT, _Traits> __istream_type;
typedef typename __istream_type::__streambuf_type __streambuf_type;
typedef typename __istream_type::__ctype_type __ctype_type;
typedef typename __istream_type::int_type __int_type;
typedef typename __istream_type::__ctype_type __ctype_type;
typedef typename __istream_type::int_type __int_type;
const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
const __int_type __eof = _Traits::eof();
const __int_type __eof = _Traits::eof();
__streambuf_type* __sb = __in.rdbuf();
__int_type __c = __sb->sgetc();
while (!_Traits::eq_int_type(__c, __eof)
while (!_Traits::eq_int_type(__c, __eof)
&& __ct.is(ctype_base::space, _Traits::to_char_type(__c)))
__c = __sb->snextc();
@ -1011,17 +1011,17 @@ namespace std
operator>>(basic_istream<_CharT, _Traits>& __in,
basic_string<_CharT, _Traits, _Alloc>& __str)
{
typedef basic_istream<_CharT, _Traits> __istream_type;
typedef typename __istream_type::int_type __int_type;
typedef basic_istream<_CharT, _Traits> __istream_type;
typedef typename __istream_type::int_type __int_type;
typedef typename __istream_type::__streambuf_type __streambuf_type;
typedef typename __istream_type::__ctype_type __ctype_type;
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
typedef typename __istream_type::__ctype_type __ctype_type;
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
typedef typename __string_type::size_type __size_type;
__size_type __extracted = 0;
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
typename __istream_type::sentry __cerb(__in, false);
if (__cerb)
if (__cerb)
{
try
{
@ -1029,13 +1029,13 @@ namespace std
streamsize __w = __in.width();
__size_type __n;
__n = __w > 0 ? static_cast<__size_type>(__w) : __str.max_size();
const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
const __int_type __eof = _Traits::eof();
__streambuf_type* __sb = __in.rdbuf();
__int_type __c = __sb->sgetc();
while (__extracted < __n
while (__extracted < __n
&& !_Traits::eq_int_type(__c, __eof)
&& !__ct.is(ctype_base::space, _Traits::to_char_type(__c)))
{
@ -1068,11 +1068,11 @@ namespace std
getline(basic_istream<_CharT, _Traits>& __in,
basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim)
{
typedef basic_istream<_CharT, _Traits> __istream_type;
typedef typename __istream_type::int_type __int_type;
typedef basic_istream<_CharT, _Traits> __istream_type;
typedef typename __istream_type::int_type __int_type;
typedef typename __istream_type::__streambuf_type __streambuf_type;
typedef typename __istream_type::__ctype_type __ctype_type;
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
typedef typename __istream_type::__ctype_type __ctype_type;
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
typedef typename __string_type::size_type __size_type;
__size_type __extracted = 0;
@ -1080,7 +1080,7 @@ namespace std
bool __testdelim = false;
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
typename __istream_type::sentry __cerb(__in, true);
if (__cerb)
if (__cerb)
{
try
{
@ -1090,7 +1090,7 @@ namespace std
__int_type __c = __sb->sbumpc();
const __int_type __eof = _Traits::eof();
__testdelim = _Traits::eq_int_type(__c, __idelim);
while (!_Traits::eq_int_type(__c, __eof) && !__testdelim
&& __extracted < __n)
{
@ -1119,12 +1119,12 @@ namespace std
template<class _CharT, class _Traits, class _Alloc>
inline basic_istream<_CharT,_Traits>&
getline(basic_istream<_CharT, _Traits>& __in,
getline(basic_istream<_CharT, _Traits>& __in,
basic_string<_CharT,_Traits,_Alloc>& __str)
{ return getline(__in, __str, __in.widen('\n')); }
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
// which are defined via explicit instantiations elsewhere.
// NB: This syntax is a GNU extension.
#if _GLIBCXX_EXTERN_TEMPLATE
extern template class basic_istream<char>;

View File

@ -78,7 +78,7 @@ namespace __gnu_norm
_M_put_node(__tmp);
}
}
template<typename _Tp, typename _Alloc>
typename list<_Tp,_Alloc>::iterator
list<_Tp,_Alloc>::
@ -88,7 +88,7 @@ namespace __gnu_norm
__tmp->hook(__position._M_node);
return __tmp;
}
template<typename _Tp, typename _Alloc>
typename list<_Tp,_Alloc>::iterator
list<_Tp,_Alloc>::
@ -98,7 +98,7 @@ namespace __gnu_norm
_M_erase(__position);
return __ret;
}
template<typename _Tp, typename _Alloc>
void
list<_Tp,_Alloc>::
@ -113,7 +113,7 @@ namespace __gnu_norm
else // __i == end()
insert(end(), __new_size - __len, __x);
}
template<typename _Tp, typename _Alloc>
list<_Tp,_Alloc>&
list<_Tp,_Alloc>::
@ -134,7 +134,7 @@ namespace __gnu_norm
}
return *this;
}
template<typename _Tp, typename _Alloc>
void
list<_Tp,_Alloc>::
@ -148,17 +148,17 @@ namespace __gnu_norm
else
erase(__i, end());
}
template<typename _Tp, typename _Alloc>
template <typename _InputIterator>
void
list<_Tp,_Alloc>::
_M_assign_dispatch(_InputIterator __first2, _InputIterator __last2,
_M_assign_dispatch(_InputIterator __first2, _InputIterator __last2,
__false_type)
{
iterator __first1 = begin();
iterator __last1 = end();
for (; __first1 != __last1 && __first2 != __last2;
for (; __first1 != __last1 && __first2 != __last2;
++__first1, ++__first2)
*__first1 = *__first2;
if (__first2 == __last2)
@ -166,7 +166,7 @@ namespace __gnu_norm
else
insert(__last1, __first2, __last2);
}
template<typename _Tp, typename _Alloc>
void
list<_Tp,_Alloc>::
@ -183,7 +183,7 @@ namespace __gnu_norm
__first = __next;
}
}
template<typename _Tp, typename _Alloc>
void
list<_Tp,_Alloc>::
@ -203,7 +203,7 @@ namespace __gnu_norm
__next = __first;
}
}
template<typename _Tp, typename _Alloc>
void
list<_Tp,_Alloc>::
@ -230,14 +230,14 @@ namespace __gnu_norm
_M_transfer(__last1, __first2, __last2);
}
}
template<typename _Tp, typename _Alloc>
void
list<_Tp,_Alloc>::
sort()
{
// Do nothing if the list has length 0 or 1.
if (this->_M_node._M_next != &this->_M_node
if (this->_M_node._M_next != &this->_M_node
&& this->_M_node._M_next->_M_next != &this->_M_node)
{
list __carry;
@ -248,7 +248,7 @@ namespace __gnu_norm
do
{
__carry.splice(__carry.begin(), *this, begin());
for(__counter = &__tmp[0];
(__counter != __fill) && !__counter->empty();
++__counter)
@ -267,7 +267,7 @@ namespace __gnu_norm
swap( *(__fill-1) );
}
}
template<typename _Tp, typename _Alloc>
template <typename _Predicate>
void
@ -285,7 +285,7 @@ namespace __gnu_norm
__first = __next;
}
}
template<typename _Tp, typename _Alloc>
template <typename _BinaryPredicate>
void
@ -305,7 +305,7 @@ namespace __gnu_norm
__next = __first;
}
}
template<typename _Tp, typename _Alloc>
template <typename _StrictWeakOrdering>
void
@ -313,7 +313,7 @@ namespace __gnu_norm
merge(list& __x, _StrictWeakOrdering __comp)
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 300. list::merge() specification incomplete
// 300. list::merge() specification incomplete
if (this != &__x)
{
iterator __first1 = begin();
@ -333,7 +333,7 @@ namespace __gnu_norm
_M_transfer(__last1, __first2, __last2);
}
}
template<typename _Tp, typename _Alloc>
template <typename _StrictWeakOrdering>
void
@ -348,11 +348,11 @@ namespace __gnu_norm
list __tmp[64];
list * __fill = &__tmp[0];
list * __counter;
do
{
__carry.splice(__carry.begin(), *this, begin());
for(__counter = &__tmp[0];
(__counter != __fill) && !__counter->empty();
++__counter)
@ -365,7 +365,7 @@ namespace __gnu_norm
++__fill;
}
while ( !empty() );
for (__counter = &__tmp[1]; __counter != __fill; ++__counter)
__counter->merge( *(__counter-1), __comp );
swap( *(__fill-1) );

View File

@ -80,16 +80,16 @@ namespace std
friend class _Impl;
template<typename _Facet>
friend bool
friend bool
has_facet(const locale&) throw();
template<typename _Facet>
friend const _Facet&
friend const _Facet&
use_facet(const locale&);
template<typename _Cache>
friend struct __use_cache;
//@{
/**
* @brief Category values.
@ -103,18 +103,18 @@ namespace std
* @endif
*/
static const category none = 0;
static const category ctype = 1L << 0;
static const category numeric = 1L << 1;
static const category collate = 1L << 2;
static const category time = 1L << 3;
static const category monetary = 1L << 4;
static const category messages = 1L << 5;
static const category all = (ctype | numeric | collate |
time | monetary | messages);
static const category ctype = 1L << 0;
static const category numeric = 1L << 1;
static const category collate = 1L << 2;
static const category time = 1L << 3;
static const category monetary = 1L << 4;
static const category messages = 1L << 5;
static const category all = (ctype | numeric | collate |
time | monetary | messages);
//@}
// Construct/copy/destroy:
/**
* @brief Default constructor.
*
@ -140,7 +140,7 @@ namespace std
* @param s Name of the locale to construct.
* @throw std::runtime_error if s is null or an undefined locale.
*/
explicit
explicit
locale(const char* __s);
/**
@ -152,7 +152,7 @@ namespace std
*
* @param base The locale to copy.
* @param s Name of the locale to use facets from.
* @param cat Set of categories defining the facets to use from s.
* @param cat Set of categories defining the facets to use from s.
* @throw std::runtime_error if s is null or an undefined locale.
*/
locale(const locale& __base, const char* __s, category __cat);
@ -210,7 +210,7 @@ namespace std
* @throw std::runtime_error if other has no facet of type Facet.
*/
template<typename _Facet>
locale
locale
combine(const locale& __other) const;
// Locale operations:
@ -218,7 +218,7 @@ namespace std
* @brief Return locale name.
* @return Locale name or "*" if unnamed.
*/
string
string
name() const;
/**
@ -226,9 +226,9 @@ namespace std
*
* @param other The locale to compare against.
* @return True if other and this refer to the same locale instance, are
* copies, or have the same name. False otherwise.
* copies, or have the same name. False otherwise.
*/
bool
bool
operator==(const locale& __other) const throw ();
/**
@ -237,7 +237,7 @@ namespace std
* @param other The locale to compare against.
* @return ! (*this == other)
*/
inline bool
inline bool
operator!=(const locale& __other) const throw ()
{ return !(this->operator==(__other)); }
@ -257,7 +257,7 @@ namespace std
* @return True if collate<Char> facet compares s1 < s2, else false.
*/
template<typename _Char, typename _Traits, typename _Alloc>
bool
bool
operator()(const basic_string<_Char, _Traits, _Alloc>& __s1,
const basic_string<_Char, _Traits, _Alloc>& __s2) const;
@ -272,26 +272,26 @@ namespace std
* @param locale The new locale to make global.
* @return Copy of the old global locale.
*/
static locale
static locale
global(const locale&);
/**
* @brief Return reference to the "C" locale.
*/
static const locale&
static const locale&
classic();
private:
// The (shared) implementation
_Impl* _M_impl;
_Impl* _M_impl;
// The "C" reference locale
static _Impl* _S_classic;
// Current global locale
static _Impl* _S_global;
static _Impl* _S_global;
// Names of underlying locale categories.
// Names of underlying locale categories.
// NB: locale::global() has to know how to modify all the
// underlying categories, not just the ones required by the C++
// standard.
@ -313,16 +313,16 @@ namespace std
static __gthread_once_t _S_once;
#endif
explicit
explicit
locale(_Impl*) throw();
static void
static void
_S_initialize();
static void
_S_initialize_once();
static category
static category
_S_normalize_category(category);
void
@ -355,10 +355,10 @@ namespace std
static const char _S_c_name[2];
#ifdef __GTHREADS
static __gthread_once_t _S_once;
static __gthread_once_t _S_once;
#endif
static void
static void
_S_initialize_once();
protected:
@ -371,16 +371,16 @@ namespace std
*
* @param refs The initial value for reference count.
*/
explicit
explicit
facet(size_t __refs = 0) throw() : _M_refcount(__refs ? 1 : 0)
{ }
/// Facet destructor.
virtual
virtual
~facet();
static void
_S_create_c_locale(__c_locale& __cloc, const char* __s,
_S_create_c_locale(__c_locale& __cloc, const char* __s,
__c_locale __old = 0);
static __c_locale
@ -407,16 +407,16 @@ namespace std
{
if (__exchange_and_add(&_M_refcount, -1) == 1)
{
try
{ delete this; }
catch (...)
try
{ delete this; }
catch (...)
{ }
}
}
facet(const facet&); // Not defined.
void
void
operator=(const facet&); // Not defined.
};
@ -438,22 +438,22 @@ namespace std
friend class locale::_Impl;
template<typename _Facet>
friend const _Facet&
friend const _Facet&
use_facet(const locale&);
template<typename _Facet>
friend bool
friend bool
has_facet(const locale&) throw ();
// NB: There is no accessor for _M_index because it may be used
// before the constructor is run; the effect of calling a member
// function (even an inline) would be undefined.
mutable size_t _M_index;
mutable size_t _M_index;
// Last id number assigned.
static _Atomic_word _S_refcount;
static _Atomic_word _S_refcount;
void
void
operator=(const id&); // Not defined.
id(const id&); // Not defined.
@ -478,11 +478,11 @@ namespace std
friend class locale::facet;
template<typename _Facet>
friend bool
friend bool
has_facet(const locale&) throw();
template<typename _Facet>
friend const _Facet&
friend const _Facet&
use_facet(const locale&);
template<typename _Cache>
@ -492,29 +492,29 @@ namespace std
// Data Members.
_Atomic_word _M_refcount;
const facet** _M_facets;
size_t _M_facets_size;
size_t _M_facets_size;
const facet** _M_caches;
char** _M_names;
static const locale::id* const _S_id_ctype[];
static const locale::id* const _S_id_numeric[];
static const locale::id* const _S_id_collate[];
static const locale::id* const _S_id_time[];
static const locale::id* const _S_id_monetary[];
static const locale::id* const _S_id_messages[];
char** _M_names;
static const locale::id* const _S_id_ctype[];
static const locale::id* const _S_id_numeric[];
static const locale::id* const _S_id_collate[];
static const locale::id* const _S_id_time[];
static const locale::id* const _S_id_monetary[];
static const locale::id* const _S_id_messages[];
static const locale::id* const* const _S_facet_categories[];
inline void
inline void
_M_add_reference() throw()
{ __atomic_add(&_M_refcount, 1); }
inline void
inline void
_M_remove_reference() throw()
{
if (__exchange_and_add(&_M_refcount, -1) == 1)
{
try
{ delete this; }
catch(...)
try
{ delete this; }
catch(...)
{ }
}
}
@ -527,7 +527,7 @@ namespace std
_Impl(const _Impl&); // Not defined.
void
void
operator=(const _Impl&); // Not defined.
inline bool
@ -539,29 +539,29 @@ namespace std
return __ret;
}
void
void
_M_replace_categories(const _Impl*, category);
void
void
_M_replace_category(const _Impl*, const locale::id* const*);
void
void
_M_replace_facet(const _Impl*, const locale::id*);
void
void
_M_install_facet(const locale::id*, const facet*);
template<typename _Facet>
inline void
inline void
_M_init_facet(_Facet* __facet)
{ _M_install_facet(&_Facet::id, __facet); }
void
_M_install_cache(const facet* __cache, size_t __index) throw()
{
{
__cache->_M_add_reference();
_M_caches[__index] = __cache;
}
_M_caches[__index] = __cache;
}
};
template<typename _Facet>
@ -584,7 +584,7 @@ namespace std
{
_M_impl->_M_remove_reference();
for (size_t __j = 0; __j < __i; ++__j)
delete [] _M_tmp_names[__j];
delete [] _M_tmp_names[__j];
__throw_exception_again;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -44,7 +44,7 @@
#include <bits/c++config.h>
#include <bits/c++locale.h> // Defines __c_locale, config-specific includes
#include <iosfwd> // For ostreambuf_iterator, istreambuf_iterator
#include <iosfwd> // For ostreambuf_iterator, istreambuf_iterator
#include <bits/functexcept.h>
namespace std
@ -53,67 +53,67 @@ namespace std
class locale;
// 22.1.3 Convenience interfaces
template<typename _CharT>
inline bool
template<typename _CharT>
inline bool
isspace(_CharT, const locale&);
template<typename _CharT>
inline bool
template<typename _CharT>
inline bool
isprint(_CharT, const locale&);
template<typename _CharT>
inline bool
template<typename _CharT>
inline bool
iscntrl(_CharT, const locale&);
template<typename _CharT>
inline bool
template<typename _CharT>
inline bool
isupper(_CharT, const locale&);
template<typename _CharT>
inline bool
template<typename _CharT>
inline bool
islower(_CharT, const locale&);
template<typename _CharT>
inline bool
template<typename _CharT>
inline bool
isalpha(_CharT, const locale&);
template<typename _CharT>
inline bool
template<typename _CharT>
inline bool
isdigit(_CharT, const locale&);
template<typename _CharT>
inline bool
template<typename _CharT>
inline bool
ispunct(_CharT, const locale&);
template<typename _CharT>
inline bool
template<typename _CharT>
inline bool
isxdigit(_CharT, const locale&);
template<typename _CharT>
inline bool
template<typename _CharT>
inline bool
isalnum(_CharT, const locale&);
template<typename _CharT>
inline bool
template<typename _CharT>
inline bool
isgraph(_CharT, const locale&);
template<typename _CharT>
inline _CharT
template<typename _CharT>
inline _CharT
toupper(_CharT, const locale&);
template<typename _CharT>
inline _CharT
template<typename _CharT>
inline _CharT
tolower(_CharT, const locale&);
// 22.2.1 and 22.2.1.3 ctype
class ctype_base;
template<typename _CharT>
template<typename _CharT>
class ctype;
template<> class ctype<char>;
#ifdef _GLIBCXX_USE_WCHAR_T
template<> class ctype<wchar_t>;
#endif
template<typename _CharT>
template<typename _CharT>
class ctype_byname;
// NB: Specialized for char and wchar_t in locale_facets.h.
@ -137,9 +137,9 @@ namespace std
template<typename _CharT> class numpunct_byname;
// 22.2.4 collation
template<typename _CharT>
template<typename _CharT>
class collate;
template<typename _CharT> class
template<typename _CharT> class
collate_byname;
// 22.2.5 date and time
@ -159,16 +159,16 @@ namespace std
class money_get;
template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
class money_put;
template<typename _CharT, bool _Intl = false>
template<typename _CharT, bool _Intl = false>
class moneypunct;
template<typename _CharT, bool _Intl = false>
template<typename _CharT, bool _Intl = false>
class moneypunct_byname;
// 22.2.7 message retrieval
class messages_base;
template<typename _CharT>
template<typename _CharT>
class messages;
template<typename _CharT>
template<typename _CharT>
class messages_byname;
template<typename _Facet>
@ -182,9 +182,9 @@ namespace std
template<typename _Facet>
inline const _Facet&
__check_facet(const _Facet* __f)
{
{
if (!__f)
__throw_bad_cast();
__throw_bad_cast();
return *__f;
}
} // namespace std

View File

@ -57,23 +57,23 @@ namespace std {
*
* @param Tp Element type.
*/
template <class _Tp>
template <class _Tp>
class mask_array
{
{
public:
typedef _Tp value_type;
void operator=(const valarray<_Tp>&) const;
/// Multiply slice elements by corresponding elements of @a v.
void operator*=(const valarray<_Tp>&) const;
/// Divide slice elements by corresponding elements of @a v.
void operator/=(const valarray<_Tp>&) const;
/// Modulo slice elements by corresponding elements of @a v.
void operator%=(const valarray<_Tp>&) const;
void operator%=(const valarray<_Tp>&) const;
/// Add corresponding elements of @a v to slice elements.
void operator+=(const valarray<_Tp>&) const;
/// Subtract corresponding elements of @a v from slice elements.
void operator-=(const valarray<_Tp>&) const;
void operator-=(const valarray<_Tp>&) const;
/// Logical xor slice elements with corresponding elements of @a v.
void operator^=(const valarray<_Tp>&) const;
/// Logical and slice elements with corresponding elements of @a v.
@ -83,12 +83,12 @@ namespace std {
/// Left shift slice elements by corresponding elements of @a v.
void operator<<=(const valarray<_Tp>&) const;
/// Right shift slice elements by corresponding elements of @a v.
void operator>>=(const valarray<_Tp>&) const;
void operator>>=(const valarray<_Tp>&) const;
/// Assign all slice elements to @a t.
void operator=(const _Tp&) const;
// ~mask_array ();
template<class _Dom>
void operator=(const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
@ -110,19 +110,19 @@ namespace std {
template<class _Dom>
void operator<<=(const _Expr<_Dom,_Tp>&) const;
template<class _Dom>
void operator>>=(const _Expr<_Dom,_Tp>&) const;
void operator>>=(const _Expr<_Dom,_Tp>&) const;
private:
mask_array(_Array<_Tp>, size_t, _Array<bool>);
friend class valarray<_Tp>;
const size_t _M_sz;
const _Array<bool> _M_mask;
const _Array<_Tp> _M_array;
/// Copy constructor. Both slices refer to the same underlying array.
mask_array (const mask_array&);
// not implemented
mask_array();
@ -137,15 +137,15 @@ namespace std {
: _M_sz(a._M_sz), _M_mask(a._M_mask), _M_array(a._M_array) {}
template<typename _Tp>
inline
inline
mask_array<_Tp>::mask_array(_Array<_Tp> __a, size_t __s, _Array<bool> __m)
: _M_sz(__s), _M_mask(__m), _M_array(__a) {}
template<typename _Tp>
inline void
mask_array<_Tp>::operator=(const _Tp& __t) const
{ std::__valarray_fill(_M_array, _M_sz, _M_mask, __t); }
template<typename _Tp>
inline void
mask_array<_Tp>::operator=(const valarray<_Tp>& __v) const
@ -186,8 +186,8 @@ _DEFINE_VALARRAY_OPERATOR(|, __bitwise_or)
_DEFINE_VALARRAY_OPERATOR(<<, __shift_left)
_DEFINE_VALARRAY_OPERATOR(>>, __shift_right)
#undef _DEFINE_VALARRAY_OPERATOR
#undef _DEFINE_VALARRAY_OPERATOR
} // std::
#endif /* _MASK_ARRAY_H */

View File

@ -39,7 +39,7 @@
#include <locale>
namespace std
namespace std
{
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>::sentry::
@ -58,9 +58,9 @@ namespace std
__os.setstate(ios_base::failbit);
}
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(__ostream_type& (*__pf)(__ostream_type&))
{
@ -69,9 +69,9 @@ namespace std
// The inserters for manipulators are *not* formatted output functions.
return __pf(*this);
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(__ios_type& (*__pf)(__ios_type&))
{
@ -83,7 +83,7 @@ namespace std
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(ios_base& (*__pf)(ios_base&))
{
@ -95,15 +95,15 @@ namespace std
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(bool __n)
{
sentry __cerb(*this);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
const __num_put_type& __np = __check_facet(this->_M_num_put);
if (__np.put(*this, *this, this->fill(), __n).failed())
@ -118,15 +118,15 @@ namespace std
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(long __n)
{
sentry __cerb(*this);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
bool __b = false;
char_type __c = this->fill();
@ -139,7 +139,7 @@ namespace std
}
else
__b = __np.put(*this, *this, __c, __n).failed();
if (__b)
if (__b)
__err |= ios_base::badbit;
}
catch(...)
@ -151,15 +151,15 @@ namespace std
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(unsigned long __n)
{
sentry __cerb(*this);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
const __num_put_type& __np = __check_facet(this->_M_num_put);
if (__np.put(*this, *this, this->fill(), __n).failed())
@ -175,15 +175,15 @@ namespace std
#ifdef _GLIBCXX_USE_LONG_LONG
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(long long __n)
{
sentry __cerb(*this);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
bool __b = false;
char_type __c = this->fill();
@ -197,7 +197,7 @@ namespace std
}
else
__b = __np.put(*this, *this, __c, __n).failed();
if (__b)
if (__b)
__err |= ios_base::badbit;
}
catch(...)
@ -209,15 +209,15 @@ namespace std
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(unsigned long long __n)
{
sentry __cerb(*this);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
const __num_put_type& __np = __check_facet(this->_M_num_put);
if (__np.put(*this, *this, this->fill(), __n).failed())
@ -231,17 +231,17 @@ namespace std
return *this;
}
#endif
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(double __n)
{
sentry __cerb(*this);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
const __num_put_type& __np = __check_facet(this->_M_num_put);
if (__np.put(*this, *this, this->fill(), __n).failed())
@ -254,17 +254,17 @@ namespace std
}
return *this;
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(long double __n)
{
sentry __cerb(*this);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
const __num_put_type& __np = __check_facet(this->_M_num_put);
if (__np.put(*this, *this, this->fill(), __n).failed())
@ -279,15 +279,15 @@ namespace std
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(const void* __n)
{
sentry __cerb(*this);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
try
{
const __num_put_type& __np = __check_facet(this->_M_num_put);
if (__np.put(*this, *this, this->fill(), __n).failed())
@ -302,7 +302,7 @@ namespace std
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(__streambuf_type* __sbin)
{
@ -329,7 +329,7 @@ namespace std
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
put(char_type __c)
{
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR 60. What is a formatted input function?
// basic_ostream::put(char_type) is an unformatted output function.
@ -337,12 +337,12 @@ namespace std
// Unformatted output functions should catch exceptions thrown
// from streambuf members.
sentry __cerb(*this);
if (__cerb)
if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
int_type __put = this->rdbuf()->sputc(__c);
int_type __put = this->rdbuf()->sputc(__c);
if (traits_type::eq_int_type(__put, traits_type::eof()))
__err |= ios_base::badbit;
}
@ -351,7 +351,7 @@ namespace std
if (__err)
this->setstate(__err);
}
return *this;
return *this;
}
template<typename _CharT, typename _Traits>
@ -397,7 +397,7 @@ namespace std
this->setstate(__err);
return *this;
}
template<typename _CharT, typename _Traits>
typename basic_ostream<_CharT, _Traits>::pos_type
basic_ostream<_CharT, _Traits>::
@ -427,7 +427,7 @@ namespace std
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
pos_type __p = this->rdbuf()->pubseekpos(__pos, ios_base::out);
// 129. Need error indication from seekp() and seekg()
if (__p == pos_type(off_type(-1)))
__err |= ios_base::failbit;
@ -452,9 +452,9 @@ namespace std
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
ios_base::out);
// 129. Need error indication from seekp() and seekg()
if (__p == pos_type(off_type(-1)))
__err |= ios_base::failbit;
@ -476,7 +476,7 @@ namespace std
typename __ostream_type::sentry __cerb(__out);
if (__cerb)
{
try
try
{
const streamsize __w = __out.width();
streamsize __len = 1;
@ -485,7 +485,7 @@ namespace std
{
__cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
* __w));
__pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs,
__pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs,
&__c, __w, __len, false);
__len = __w;
}
@ -497,9 +497,9 @@ namespace std
}
return __out;
}
// Specializations.
template <class _Traits>
template <class _Traits>
basic_ostream<char, _Traits>&
operator<<(basic_ostream<char, _Traits>& __out, char __c)
{
@ -507,7 +507,7 @@ namespace std
typename __ostream_type::sentry __cerb(__out);
if (__cerb)
{
try
try
{
const streamsize __w = __out.width();
streamsize __len = 1;
@ -515,7 +515,7 @@ namespace std
if (__w > __len)
{
__cs = static_cast<char*>(__builtin_alloca(__w));
__pad<char, _Traits>::_S_pad(__out, __out.fill(), __cs,
__pad<char, _Traits>::_S_pad(__out, __out.fill(), __cs,
&__c, __w, __len, false);
__len = __w;
}
@ -536,7 +536,7 @@ namespace std
typename __ostream_type::sentry __cerb(__out);
if (__cerb && __s)
{
try
try
{
const streamsize __w = __out.width();
streamsize __len = static_cast<streamsize>(_Traits::length(__s));
@ -544,7 +544,7 @@ namespace std
{
_CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
* __w));
__pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs,
__pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs,
__s, __w, __len, false);
__s = __cs;
__len = __w;
@ -578,8 +578,8 @@ namespace std
for (size_t __i = 0; __i < __clen; ++__i)
__ws[__i] = __out.widen(__s[__i]);
_CharT* __str = __ws;
try
try
{
const streamsize __w = __out.width();
streamsize __len = static_cast<streamsize>(__clen);
@ -587,7 +587,7 @@ namespace std
{
_CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
* __w));
__pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs,
__pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs,
__ws, __w, __len, false);
__str = __cs;
__len = __w;
@ -612,14 +612,14 @@ namespace std
typename __ostream_type::sentry __cerb(__out);
if (__cerb && __s)
{
try
try
{
const streamsize __w = __out.width();
streamsize __len = static_cast<streamsize>(_Traits::length(__s));
if (__w > __len)
{
char* __cs = static_cast<char*>(__builtin_alloca(__w));
__pad<char, _Traits>::_S_pad(__out, __out.fill(), __cs,
__pad<char, _Traits>::_S_pad(__out, __out.fill(), __cs,
__s, __w, __len, false);
__s = __cs;
__len = __w;
@ -640,7 +640,7 @@ namespace std
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __out,
const basic_string<_CharT, _Traits, _Alloc>& __str)
{
{
typedef basic_ostream<_CharT, _Traits> __ostream_type;
typename __ostream_type::sentry __cerb(__out);
if (__cerb)
@ -666,7 +666,7 @@ namespace std
}
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
// which are defined via explicit instantiations elsewhere.
// NB: This syntax is a GNU extension.
#if _GLIBCXX_EXTERN_TEMPLATE
extern template class basic_ostream<char>;

View File

@ -158,8 +158,8 @@ namespace std
private:
friend class streamoff;
__streamoff_base_type _M_off;
_StateT _M_state;
__streamoff_base_type _M_off;
_StateT _M_state;
public:
// The standard doesn't require that fpos objects can be default

View File

@ -69,14 +69,14 @@ namespace std
* @param s Stride between array elements.
*/
slice(size_t, size_t, size_t);
/// Return array offset of first slice element.
size_t start() const;
/// Return size of slice.
size_t size() const;
/// Return array stride of slice.
size_t stride() const;
private:
size_t _M_off; // offset
size_t _M_sz; // size
@ -85,21 +85,21 @@ namespace std
// The default constructor constructor is not required to initialize
// data members with any meaningful values, so we choose to do nothing.
inline
inline
slice::slice() {}
inline
inline
slice::slice(size_t __o, size_t __d, size_t __s)
: _M_off(__o), _M_sz(__d), _M_st(__s) {}
inline size_t
slice::start() const
{ return _M_off; }
inline size_t
slice::size() const
{ return _M_sz; }
inline size_t
slice::stride() const
{ return _M_st; }
@ -194,16 +194,16 @@ namespace std
};
template<typename _Tp>
inline
inline
slice_array<_Tp>::slice_array(_Array<_Tp> __a, const slice& __s)
: _M_sz(__s.size()), _M_stride(__s.stride()),
_M_array(__a.begin() + __s.start()) {}
template<typename _Tp>
inline
inline
slice_array<_Tp>::slice_array(const slice_array<_Tp>& a)
: _M_sz(a._M_sz), _M_stride(a._M_stride), _M_array(a._M_array) {}
// template<typename _Tp>
// inline slice_array<_Tp>::~slice_array () {}
@ -220,12 +220,12 @@ namespace std
inline void
slice_array<_Tp>::operator=(const _Tp& __t) const
{ std::__valarray_fill(_M_array, _M_sz, _M_stride, __t); }
template<typename _Tp>
inline void
slice_array<_Tp>::operator=(const valarray<_Tp>& __v) const
{ std::__valarray_copy(_Array<_Tp>(__v), _M_array, _M_sz, _M_stride); }
template<typename _Tp>
template<class _Dom>
inline void
@ -248,7 +248,7 @@ namespace std
{ \
_Array_augmented_##_Name(_M_array, _M_stride, __e, _M_sz); \
}
_DEFINE_VALARRAY_OPERATOR(*, __multiplies)
_DEFINE_VALARRAY_OPERATOR(/, __divides)

View File

@ -42,13 +42,13 @@
namespace std
{
template <class _CharT, class _Traits, class _Alloc>
typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
basic_stringbuf<_CharT, _Traits, _Alloc>::
pbackfail(int_type __c)
{
int_type __ret = traits_type::eof();
const bool __testeof = traits_type::eq_int_type(__c, __ret);
if (this->eback() < this->gptr())
{
const bool __testeq = traits_type::eq(traits_type::to_char_type(__c),
@ -69,9 +69,9 @@ namespace std
}
return __ret;
}
template <class _CharT, class _Traits, class _Alloc>
typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
basic_stringbuf<_CharT, _Traits, _Alloc>::
overflow(int_type __c)
{
@ -111,7 +111,7 @@ namespace std
}
template <class _CharT, class _Traits, class _Alloc>
typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
basic_stringbuf<_CharT, _Traits, _Alloc>::
underflow()
{
@ -132,7 +132,7 @@ namespace std
basic_stringbuf<_CharT, _Traits, _Alloc>::
seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __mode)
{
pos_type __ret = pos_type(off_type(-1));
pos_type __ret = pos_type(off_type(-1));
bool __testin = (ios_base::in & this->_M_mode & __mode) != 0;
bool __testout = (ios_base::out & this->_M_mode & __mode) != 0;
const bool __testboth = __testin && __testout && __way != ios_base::cur;
@ -156,14 +156,14 @@ namespace std
__newoffo = __newoffi = this->egptr() - __beg;
if ((__testin || __testboth)
&& __newoffi + __off >= 0
&& __newoffi + __off >= 0
&& this->egptr() - __beg >= __newoffi + __off)
{
this->gbump((__beg + __newoffi + __off) - this->gptr());
__ret = pos_type(__newoffi);
}
if ((__testout || __testboth)
&& __newoffo + __off >= 0
&& __newoffo + __off >= 0
&& this->egptr() - __beg >= __newoffo + __off)
{
this->pbump((__beg + __newoffo + __off) - this->pptr());
@ -178,14 +178,14 @@ namespace std
basic_stringbuf<_CharT, _Traits, _Alloc>::
seekpos(pos_type __sp, ios_base::openmode __mode)
{
pos_type __ret = pos_type(off_type(-1));
pos_type __ret = pos_type(off_type(-1));
if (_M_string.capacity())
{
off_type __pos (__sp);
const bool __testin = (ios_base::in & this->_M_mode & __mode) != 0;
const bool __testout = (ios_base::out & this->_M_mode & __mode) != 0;
char_type* __beg = __testin ? this->eback() : this->pbase();
_M_update_egptr();
const bool __testpos = 0 <= __pos
@ -203,7 +203,7 @@ namespace std
}
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
// which are defined via explicit instantiations elsewhere.
// NB: This syntax is a GNU extension.
#if _GLIBCXX_EXTERN_TEMPLATE
extern template class basic_stringbuf<char>;

View File

@ -211,7 +211,7 @@ namespace std
if (*__first == __val)
return __first;
++__first;
if (*__first == __val)
return __first;
++__first;
@ -1624,7 +1624,7 @@ namespace std
{
const _ValueType __tmp = *__first;
_RandomAccessIterator __p = __first;
if (__k < __l)
{
for (_Distance __j = 0; __j < __l / __d; __j++)
@ -1652,7 +1652,7 @@ namespace std
__p -= __l;
}
}
*__p = __tmp;
++__first;
}
@ -1743,7 +1743,7 @@ namespace std
_RandomAccessIterator>)
__glibcxx_requires_valid_range(__first, __last);
if (__first != __last)
if (__first != __last)
for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
std::iter_swap(__i, __first + (std::rand() % ((__i - __first) + 1)));
}
@ -1850,7 +1850,7 @@ namespace std
* @return An iterator @p middle such that @p pred(i) is true for each
* iterator @p i in the range @p [first,middle) and false for each @p i
* in the range @p [middle,last).
*
*
* @p pred must not modify its operand. @p partition() does not preserve
* the relative ordering of elements in each group, use
* @p stable_partition() if this is needed.
@ -1959,7 +1959,7 @@ namespace std
* @return An iterator @p middle such that @p pred(i) is true for each
* iterator @p i in the range @p [first,middle) and false for each @p i
* in the range @p [middle,last).
*
*
* Performs the same function as @p partition() with the additional
* guarantee that the relative ordering of elements in each group is
* preserved, so any two elements @p x and @p y in the range
@ -2477,10 +2477,10 @@ namespace std
std::__unguarded_partition(__first, __last,
_ValueType(std::__median(*__first,
*(__first
+ (__last
- __first)
+ (__last
- __first)
/ 2),
*(__last
*(__last
- 1))));
std::__introsort_loop(__cut, __last, __depth_limit);
__last = __cut;
@ -3095,7 +3095,7 @@ namespace std
__first += __two_step;
}
__step_size = std::min(_Distance(__last - __first), __step_size);
std::merge(__first, __first + __step_size,
__first + __step_size, __last,
__result,
@ -3673,7 +3673,7 @@ namespace std
*
* Rearranges the elements in the range @p [first,last) so that @p *nth
* is the same element that would have been in that position had the
* whole sequence been sorted.
* whole sequence been sorted.
* whole sequence been sorted. The elements either side of @p *nth are
* not completely sorted, but for any iterator @i in the range
* @p [first,nth) and any iterator @j in the range @p [nth,last) it
@ -3753,9 +3753,9 @@ namespace std
_RandomAccessIterator __cut =
std::__unguarded_partition(__first, __last,
_ValueType(std::__median(*__first,
*(__first
*(__first
+ (__last
- __first)
- __first)
/ 2),
*(__last - 1),
__comp)), __comp);
@ -4160,7 +4160,7 @@ namespace std
*__result = *__first2;
++__first2;
}
else
else
{
*__result = *__first1;
++__first1;
@ -4168,7 +4168,7 @@ namespace std
}
++__result;
}
return std::copy(__first2, __last2, std::copy(__first1, __last1,
return std::copy(__first2, __last2, std::copy(__first1, __last1,
__result));
}
@ -4225,7 +4225,7 @@ namespace std
/**
* @brief Return the intersection of two sorted ranges using comparison
* functor.
* functor.
* @param first1 Start of first range.
* @param last1 End of first range.
* @param first2 Start of second range.
@ -4446,7 +4446,7 @@ namespace std
++__first1;
++__first2;
}
return std::copy(__first2, __last2, std::copy(__first1,
return std::copy(__first2, __last2, std::copy(__first1,
__last1, __result));
}
@ -4683,7 +4683,7 @@ namespace std
* comparison functor.
* @param first Start of range.
* @param last End of range.
* @param comp
* @param comp
* @return False if wrapped to first permutation, true otherwise.
*
* Treats all permutations of the range [first,last) as a set of
@ -4794,7 +4794,7 @@ namespace std
* comparison functor.
* @param first Start of range.
* @param last End of range.
* @param comp
* @param comp
* @return False if wrapped to last permutation, true otherwise.
*
* Treats all permutations of the range [first,last) as a set of
@ -5023,9 +5023,9 @@ namespace std
template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
typename _BinaryPredicate>
_BidirectionalIterator1
__find_end(_BidirectionalIterator1 __first1,
__find_end(_BidirectionalIterator1 __first1,
_BidirectionalIterator1 __last1,
_BidirectionalIterator2 __first2,
_BidirectionalIterator2 __first2,
_BidirectionalIterator2 __last2,
bidirectional_iterator_tag, bidirectional_iterator_tag,
_BinaryPredicate __comp)

View File

@ -126,7 +126,7 @@ namespace std
{
// concept requirements
__glibcxx_function_requires(_SGIAssignableConcept<_Tp>)
const _Tp __tmp = __a;
__a = __b;
__b = __tmp;
@ -169,7 +169,7 @@ namespace std
*/
template<typename _Tp>
inline const _Tp&
max(const _Tp& __a, const _Tp& __b)
max(const _Tp& __a, const _Tp& __b)
{
// concept requirements
__glibcxx_function_requires(_LessThanComparableConcept<_Tp>)
@ -242,7 +242,7 @@ namespace std
{
typedef typename iterator_traits<_RandomAccessIterator>::difference_type
_Distance;
for (_Distance __n = __last - __first; __n > 0; --__n)
for (_Distance __n = __last - __first; __n > 0; --__n)
{
*__result = *__first;
++__first;
@ -280,7 +280,7 @@ namespace std
template<typename _Tp>
inline _Tp*
__copy_aux2(const _Tp* __first, const _Tp* __last, _Tp* __result,
__copy_aux2(const _Tp* __first, const _Tp* __last, _Tp* __result,
__true_type)
{ return std::__copy_trivial(__first, __last, __result); }
@ -361,7 +361,7 @@ namespace std
template<typename _BidirectionalIterator1, typename _BidirectionalIterator2>
inline _BidirectionalIterator2
__copy_backward(_BidirectionalIterator1 __first,
_BidirectionalIterator1 __last,
_BidirectionalIterator1 __last,
_BidirectionalIterator2 __result,
bidirectional_iterator_tag)
{
@ -372,7 +372,7 @@ namespace std
template<typename _RandomAccessIterator, typename _BidirectionalIterator>
inline _BidirectionalIterator
__copy_backward(_RandomAccessIterator __first, _RandomAccessIterator __last,
__copy_backward(_RandomAccessIterator __first, _RandomAccessIterator __last,
_BidirectionalIterator __result, random_access_iterator_tag)
{
typename iterator_traits<_RandomAccessIterator>::difference_type __n;
@ -382,7 +382,7 @@ namespace std
}
// This dispatch class is a workaround for compilers that do not
// This dispatch class is a workaround for compilers that do not
// have partial ordering of function templates. All we're doing is
// creating a specialization so that we can turn a call to copy_backward
// into a memmove whenever possible.
@ -391,9 +391,9 @@ namespace std
struct __copy_backward_dispatch
{
static _BidirectionalIterator2
copy(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
copy(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
_BidirectionalIterator2 __result)
{ return std::__copy_backward(__first, __last, __result,
{ return std::__copy_backward(__first, __last, __result,
std::__iterator_category(__first)); }
};
@ -427,8 +427,8 @@ namespace std
typedef typename __type_traits<typename iterator_traits<_BI2>::value_type>
::has_trivial_assignment_operator _Trivial;
return
std::__copy_backward_dispatch<_BI1, _BI2, _Trivial>::copy(__first,
__last,
std::__copy_backward_dispatch<_BI1, _BI2, _Trivial>::copy(__first,
__last,
__result);
}
@ -754,7 +754,7 @@ namespace std
__glibcxx_requires_valid_range(__first1, __last1);
__glibcxx_requires_valid_range(__first2, __last2);
for (;__first1 != __last1 && __first2 != __last2; ++__first1, ++__first2)
for (;__first1 != __last1 && __first2 != __last2; ++__first1, ++__first2)
{
if (*__first1 < *__first2)
return true;
@ -790,7 +790,7 @@ namespace std
__glibcxx_requires_valid_range(__first2, __last2);
for ( ; __first1 != __last1 && __first2 != __last2
; ++__first1, ++__first2)
; ++__first1, ++__first2)
{
if (__comp(*__first1, *__first2))
return true;
@ -800,10 +800,10 @@ namespace std
return __first1 == __last1 && __first2 != __last2;
}
inline bool
lexicographical_compare(const unsigned char* __first1,
inline bool
lexicographical_compare(const unsigned char* __first1,
const unsigned char* __last1,
const unsigned char* __first2,
const unsigned char* __first2,
const unsigned char* __last2)
{
__glibcxx_requires_valid_range(__first1, __last1);
@ -838,4 +838,4 @@ namespace std
} // namespace std
#endif
#endif

View File

@ -62,45 +62,45 @@
#define _BVECTOR_H 1
namespace __gnu_norm
{
{
typedef unsigned long _Bit_type;
enum { _S_word_bit = int(CHAR_BIT * sizeof(_Bit_type)) };
struct _Bit_reference
struct _Bit_reference
{
_Bit_type * _M_p;
_Bit_type _M_mask;
_Bit_reference(_Bit_type * __x, _Bit_type __y)
_Bit_reference(_Bit_type * __x, _Bit_type __y)
: _M_p(__x), _M_mask(__y) { }
_Bit_reference() : _M_p(0), _M_mask(0) { }
operator bool() const { return !!(*_M_p & _M_mask); }
_Bit_reference&
_Bit_reference&
operator=(bool __x)
{
if (__x)
if (__x)
*_M_p |= _M_mask;
else
else
*_M_p &= ~_M_mask;
return *this;
}
_Bit_reference&
operator=(const _Bit_reference& __x)
_Bit_reference&
operator=(const _Bit_reference& __x)
{ return *this = bool(__x); }
bool
bool
operator==(const _Bit_reference& __x) const
{ return bool(*this) == bool(__x); }
bool
bool
operator<(const _Bit_reference& __x) const
{ return !bool(*this) && bool(__x); }
void
void
flip() { *_M_p ^= _M_mask; }
};
@ -112,71 +112,71 @@ namespace __gnu_norm
_Bit_iterator_base(_Bit_type * __x, unsigned int __y)
: _M_p(__x), _M_offset(__y) { }
void
_M_bump_up()
void
_M_bump_up()
{
if (_M_offset++ == _S_word_bit - 1)
if (_M_offset++ == _S_word_bit - 1)
{
_M_offset = 0;
++_M_p;
}
}
void
_M_bump_down()
void
_M_bump_down()
{
if (_M_offset-- == 0)
if (_M_offset-- == 0)
{
_M_offset = _S_word_bit - 1;
--_M_p;
}
}
void
_M_incr(ptrdiff_t __i)
void
_M_incr(ptrdiff_t __i)
{
difference_type __n = __i + _M_offset;
_M_p += __n / _S_word_bit;
__n = __n % _S_word_bit;
if (__n < 0)
if (__n < 0)
{
_M_offset = static_cast<unsigned int>(__n + _S_word_bit);
--_M_p;
}
}
else
_M_offset = static_cast<unsigned int>(__n);
}
bool
operator==(const _Bit_iterator_base& __i) const
bool
operator==(const _Bit_iterator_base& __i) const
{ return _M_p == __i._M_p && _M_offset == __i._M_offset; }
bool
operator<(const _Bit_iterator_base& __i) const
bool
operator<(const _Bit_iterator_base& __i) const
{
return _M_p < __i._M_p
|| (_M_p == __i._M_p && _M_offset < __i._M_offset);
}
bool
operator!=(const _Bit_iterator_base& __i) const
bool
operator!=(const _Bit_iterator_base& __i) const
{ return !(*this == __i); }
bool
operator>(const _Bit_iterator_base& __i) const
bool
operator>(const _Bit_iterator_base& __i) const
{ return __i < *this; }
bool
operator<=(const _Bit_iterator_base& __i) const
bool
operator<=(const _Bit_iterator_base& __i) const
{ return !(__i < *this); }
bool
operator>=(const _Bit_iterator_base& __i) const
bool
operator>=(const _Bit_iterator_base& __i) const
{ return !(*this < __i); }
};
inline ptrdiff_t
operator-(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y)
operator-(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y)
{
return _S_word_bit * (__x._M_p - __y._M_p) + __x._M_offset - __y._M_offset;
}
@ -188,76 +188,76 @@ namespace __gnu_norm
typedef _Bit_iterator iterator;
_Bit_iterator() : _Bit_iterator_base(0, 0) { }
_Bit_iterator(_Bit_type * __x, unsigned int __y)
_Bit_iterator(_Bit_type * __x, unsigned int __y)
: _Bit_iterator_base(__x, __y) { }
reference
reference
operator*() const { return reference(_M_p, 1UL << _M_offset); }
iterator&
operator++()
iterator&
operator++()
{
_M_bump_up();
return *this;
}
iterator
operator++(int)
iterator
operator++(int)
{
iterator __tmp = *this;
_M_bump_up();
return __tmp;
}
iterator&
operator--()
iterator&
operator--()
{
_M_bump_down();
return *this;
}
iterator
operator--(int)
iterator
operator--(int)
{
iterator __tmp = *this;
_M_bump_down();
return __tmp;
}
iterator&
operator+=(difference_type __i)
iterator&
operator+=(difference_type __i)
{
_M_incr(__i);
return *this;
}
iterator&
operator-=(difference_type __i)
operator-=(difference_type __i)
{
*this += -__i;
return *this;
}
iterator
operator+(difference_type __i) const
iterator
operator+(difference_type __i) const
{
iterator __tmp = *this;
return __tmp += __i;
}
iterator
operator-(difference_type __i) const
iterator
operator-(difference_type __i) const
{
iterator __tmp = *this;
return __tmp -= __i;
}
reference
reference
operator[](difference_type __i)
{ return *(*this + __i); }
};
inline _Bit_iterator
inline _Bit_iterator
operator+(ptrdiff_t __n, const _Bit_iterator& __x) { return __x + __n; }
@ -267,56 +267,56 @@ namespace __gnu_norm
typedef bool const_reference;
typedef const bool* pointer;
typedef _Bit_const_iterator const_iterator;
_Bit_const_iterator() : _Bit_iterator_base(0, 0) { }
_Bit_const_iterator(_Bit_type * __x, unsigned int __y)
_Bit_const_iterator(_Bit_type * __x, unsigned int __y)
: _Bit_iterator_base(__x, __y) { }
_Bit_const_iterator(const _Bit_iterator& __x)
_Bit_const_iterator(const _Bit_iterator& __x)
: _Bit_iterator_base(__x._M_p, __x._M_offset) { }
const_reference
operator*() const
const_reference
operator*() const
{ return _Bit_reference(_M_p, 1UL << _M_offset); }
const_iterator&
operator++()
const_iterator&
operator++()
{
_M_bump_up();
return *this;
}
const_iterator
operator++(int)
const_iterator
operator++(int)
{
const_iterator __tmp = *this;
_M_bump_up();
return __tmp;
}
const_iterator&
operator--()
const_iterator&
operator--()
{
_M_bump_down();
return *this;
}
const_iterator
operator--(int)
const_iterator
operator--(int)
{
const_iterator __tmp = *this;
_M_bump_down();
return __tmp;
}
const_iterator&
operator+=(difference_type __i)
const_iterator&
operator+=(difference_type __i)
{
_M_incr(__i);
return *this;
}
const_iterator&
operator-=(difference_type __i)
const_iterator&
operator-=(difference_type __i)
{
*this += -__i;
return *this;
@ -327,20 +327,20 @@ namespace __gnu_norm
return __tmp += __i;
}
const_iterator
operator-(difference_type __i) const
const_iterator
operator-(difference_type __i) const
{
const_iterator __tmp = *this;
return __tmp -= __i;
}
const_reference
operator[](difference_type __i)
const_reference
operator[](difference_type __i)
{ return *(*this + __i); }
};
inline _Bit_const_iterator
operator+(ptrdiff_t __n, const _Bit_const_iterator& __x)
inline _Bit_const_iterator
operator+(ptrdiff_t __n, const _Bit_const_iterator& __x)
{ return __x + __n; }
template<class _Alloc>
@ -352,30 +352,30 @@ namespace __gnu_norm
public:
typedef _Alloc allocator_type;
allocator_type
get_allocator() const
get_allocator() const
{ return *static_cast<const _Bit_alloc_type*>(this); }
_Bvector_base(const allocator_type& __a)
: _Bit_alloc_type(__a), _M_start(), _M_finish(), _M_end_of_storage(0) { }
~_Bvector_base() { this->_M_deallocate(); }
protected:
_Bit_type*
_M_bit_alloc(size_t __n)
_Bit_type*
_M_bit_alloc(size_t __n)
{ return _Bit_alloc_type::allocate((__n + _S_word_bit - 1)
/ _S_word_bit); }
void
_M_deallocate()
void
_M_deallocate()
{
if (_M_start._M_p)
_Bit_alloc_type::deallocate(_M_start._M_p,
_Bit_alloc_type::deallocate(_M_start._M_p,
_M_end_of_storage - _M_start._M_p);
}
}
_Bit_iterator _M_start;
_Bit_iterator _M_finish;
_Bit_type* _M_end_of_storage;
@ -405,36 +405,36 @@ namespace __gnu_norm
* memory and size allocation. Subscripting ( @c [] ) access is
* also provided as with C-style arrays.
*/
template<typename _Alloc>
class vector<bool, _Alloc> : public _Bvector_base<_Alloc>
template<typename _Alloc>
class vector<bool, _Alloc> : public _Bvector_base<_Alloc>
{
public:
typedef bool value_type;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef ptrdiff_t difference_type;
typedef _Bit_reference reference;
typedef bool const_reference;
typedef _Bit_reference* pointer;
typedef const bool* const_pointer;
typedef _Bit_iterator iterator;
typedef _Bit_const_iterator const_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef typename _Bvector_base<_Alloc>::allocator_type allocator_type;
allocator_type get_allocator() const
{ return _Bvector_base<_Alloc>::get_allocator(); }
protected:
using _Bvector_base<_Alloc>::_M_bit_alloc;
using _Bvector_base<_Alloc>::_M_deallocate;
using _Bvector_base<_Alloc>::_M_start;
using _Bvector_base<_Alloc>::_M_finish;
using _Bvector_base<_Alloc>::_M_end_of_storage;
protected:
void _M_initialize(size_type __n)
{
@ -466,7 +466,7 @@ template<typename _Alloc>
this->_M_start = iterator(__q, 0);
}
}
template<class _InputIterator>
void _M_initialize_range(_InputIterator __first, _InputIterator __last,
input_iterator_tag)
@ -474,10 +474,10 @@ template<typename _Alloc>
this->_M_start = iterator();
this->_M_finish = iterator();
this->_M_end_of_storage = 0;
for ( ; __first != __last; ++__first)
for ( ; __first != __last; ++__first)
push_back(*__first);
}
template<class _ForwardIterator>
void _M_initialize_range(_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag)
@ -486,7 +486,7 @@ template<typename _Alloc>
_M_initialize(__n);
std::copy(__first, __last, this->_M_start);
}
template<class _InputIterator>
void _M_insert_range(iterator __pos,
_InputIterator __first, _InputIterator __last,
@ -498,7 +498,7 @@ template<typename _Alloc>
++__pos;
}
}
template<class _ForwardIterator>
void _M_insert_range(iterator __position,
_ForwardIterator __first, _ForwardIterator __last,
@ -527,8 +527,8 @@ template<typename _Alloc>
this->_M_start = iterator(__q, 0);
}
}
}
}
public:
iterator begin()
{ return this->_M_start; }
@ -541,7 +541,7 @@ template<typename _Alloc>
const_iterator end() const
{ return this->_M_finish; }
reverse_iterator rbegin()
{ return reverse_iterator(end()); }
@ -553,7 +553,7 @@ template<typename _Alloc>
const_reverse_iterator rend() const
{ return const_reverse_iterator(begin()); }
size_type size() const
{ return size_type(end() - begin()); }
@ -565,28 +565,28 @@ template<typename _Alloc>
- begin()); }
bool empty() const
{ return begin() == end(); }
reference operator[](size_type __n)
{ return *(begin() + difference_type(__n)); }
const_reference operator[](size_type __n) const
{ return *(begin() + difference_type(__n)); }
void _M_range_check(size_type __n) const
{
if (__n >= this->size())
__throw_out_of_range(__N("vector<bool>::_M_range_check"));
}
reference at(size_type __n)
{ _M_range_check(__n); return (*this)[__n]; }
const_reference at(size_type __n) const
{ _M_range_check(__n); return (*this)[__n]; }
explicit vector(const allocator_type& __a = allocator_type())
: _Bvector_base<_Alloc>(__a) { }
vector(size_type __n, bool __value,
const allocator_type& __a = allocator_type())
: _Bvector_base<_Alloc>(__a)
@ -594,34 +594,34 @@ template<typename _Alloc>
_M_initialize(__n);
std::fill(this->_M_start._M_p, this->_M_end_of_storage, __value ? ~0 : 0);
}
explicit vector(size_type __n)
: _Bvector_base<_Alloc>(allocator_type())
{
_M_initialize(__n);
std::fill(this->_M_start._M_p, this->_M_end_of_storage, 0);
}
vector(const vector& __x) : _Bvector_base<_Alloc>(__x.get_allocator())
{
_M_initialize(__x.size());
std::copy(__x.begin(), __x.end(), this->_M_start);
}
// Check whether it's an integral type. If so, it's not an iterator.
template<class _Integer>
void _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
{
_M_initialize(__n);
std::fill(this->_M_start._M_p, this->_M_end_of_storage, __x ? ~0 : 0);
}
template<class _InputIterator>
void _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
__false_type)
{ _M_initialize_range(__first, __last, std::__iterator_category(__first)); }
template<class _InputIterator>
vector(_InputIterator __first, _InputIterator __last,
const allocator_type& __a = allocator_type())
@ -630,9 +630,9 @@ template<typename _Alloc>
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_initialize_dispatch(__first, __last, _Integral());
}
~vector() { }
vector& operator=(const vector& __x)
{
if (&__x == this)
@ -646,12 +646,12 @@ template<typename _Alloc>
this->_M_finish = begin() + difference_type(__x.size());
return *this;
}
// assign(), a generalized assignment member function. Two
// versions: one that takes a count, and one that takes a range.
// The range version is a member template, so we dispatch on whether
// or not the type is an integer.
void _M_fill_assign(size_t __n, bool __x)
{
if (__n > size())
@ -665,26 +665,26 @@ template<typename _Alloc>
std::fill(this->_M_start._M_p, this->_M_end_of_storage, __x ? ~0 : 0);
}
}
void assign(size_t __n, bool __x)
{ _M_fill_assign(__n, __x); }
template<class _InputIterator>
void assign(_InputIterator __first, _InputIterator __last)
{
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_assign_dispatch(__first, __last, _Integral());
}
template<class _Integer>
void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
{ _M_fill_assign((size_t) __n, (bool) __val); }
template<class _InputIterator>
void _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
__false_type)
{ _M_assign_aux(__first, __last, std::__iterator_category(__first)); }
template<class _InputIterator>
void _M_assign_aux(_InputIterator __first, _InputIterator __last,
input_iterator_tag)
@ -697,7 +697,7 @@ template<typename _Alloc>
else
insert(end(), __first, __last);
}
template<class _ForwardIterator>
void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag)
@ -712,8 +712,8 @@ template<typename _Alloc>
std::copy(__first, __mid, begin());
insert(end(), __mid, __last);
}
}
}
void reserve(size_type __n)
{
if (__n > this->max_size())
@ -727,7 +727,7 @@ template<typename _Alloc>
this->_M_end_of_storage = __q + (__n + _S_word_bit - 1) / _S_word_bit;
}
}
reference front()
{ return *begin(); }
@ -773,21 +773,21 @@ template<typename _Alloc>
_M_insert_aux(__position, __x);
return begin() + __n;
}
// Check whether it's an integral type. If so, it's not an iterator.
template<class _Integer>
void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
__true_type)
{ _M_fill_insert(__pos, __n, __x); }
template<class _InputIterator>
void _M_insert_dispatch(iterator __pos,
_InputIterator __first, _InputIterator __last,
__false_type)
{ _M_insert_range(__pos, __first, __last,
std::__iterator_category(__first)); }
template<class _InputIterator>
void insert(iterator __position,
_InputIterator __first, _InputIterator __last)
@ -795,7 +795,7 @@ template<typename _Alloc>
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_insert_dispatch(__position, __first, __last, _Integral());
}
void _M_fill_insert(iterator __position, size_type __n, bool __x)
{
if (__n == 0)
@ -821,10 +821,10 @@ template<typename _Alloc>
this->_M_start = iterator(__q, 0);
}
}
void insert(iterator __position, size_type __n, bool __x)
{ _M_fill_insert(__position, __n, __x); }
void pop_back()
{ --this->_M_finish; }
@ -844,7 +844,7 @@ template<typename _Alloc>
void resize(size_type __new_size, bool __x = bool())
{
if (__new_size < size())
if (__new_size < size())
erase(begin() + difference_type(__new_size), end());
else
insert(end(), __new_size - size(), __x);
@ -856,7 +856,7 @@ template<typename _Alloc>
__p != this->_M_end_of_storage; ++__p)
*__p = ~*__p;
}
void clear()
{ erase(begin(), end()); }
};

View File

@ -78,9 +78,9 @@ namespace std
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 402. wrong new expression in [some_]allocator::construct
::new(static_cast<void*>(__p)) _T1(__value);
::new(static_cast<void*>(__p)) _T1(__value);
}
/**
* @if maint
* Constructs an object in existing memory by invoking an allocated
@ -92,7 +92,7 @@ namespace std
_Construct(_T1* __p)
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 402. wrong new expression in [some_]allocator::construct
// 402. wrong new expression in [some_]allocator::construct
::new(static_cast<void*>(__p)) _T1();
}
@ -108,7 +108,7 @@ namespace std
/**
* @if maint
* Destroy a range of objects with nontrivial destructors.
* Destroy a range of objects with nontrivial destructors.
*
* This is a helper function used only by _Destroy().
* @endif
@ -128,7 +128,7 @@ namespace std
* This is a helper function used only by _Destroy().
* @endif
*/
template<typename _ForwardIterator>
template<typename _ForwardIterator>
inline void
__destroy_aux(_ForwardIterator, _ForwardIterator, __true_type)
{ }

File diff suppressed because it is too large Load Diff

View File

@ -118,7 +118,7 @@ namespace std
typedef _Arg2 second_argument_type; ///< the type of the second argument
typedef _Result result_type; ///< type of the return type
};
};
/** @} */
// 20.3.2 arithmetic
@ -132,7 +132,7 @@ namespace std
/// One of the @link s20_3_2_arithmetic math functors@endlink.
template <class _Tp>
struct plus : public binary_function<_Tp, _Tp, _Tp>
{
{
_Tp
operator()(const _Tp& __x, const _Tp& __y) const
{ return __x + __y; }
@ -193,7 +193,7 @@ namespace std
*/
/// One of the @link s20_3_3_comparisons comparison functors@endlink.
template <class _Tp>
struct equal_to : public binary_function<_Tp, _Tp, bool>
struct equal_to : public binary_function<_Tp, _Tp, bool>
{
bool
operator()(const _Tp& __x, const _Tp& __y) const
@ -202,7 +202,7 @@ namespace std
/// One of the @link s20_3_3_comparisons comparison functors@endlink.
template <class _Tp>
struct not_equal_to : public binary_function<_Tp, _Tp, bool>
struct not_equal_to : public binary_function<_Tp, _Tp, bool>
{
bool
operator()(const _Tp& __x, const _Tp& __y) const
@ -245,7 +245,7 @@ namespace std
{ return __x <= __y; }
};
/** @} */
// 20.3.4 logical operations
/** @defgroup s20_3_4_logical Boolean Operations Classes
* Here are wrapper functors for Boolean operations: @c &&, @c ||, and @c !.
@ -295,7 +295,7 @@ namespace std
* {
* bool operator() (int x) { return x > 3; }
* };
*
*
* std::find_if (v.begin(), v.end(), not1(IntGreaterThanThree()));
* \endcode
* The call to @c find_if will locate the first index (i) of @c v for which
@ -317,7 +317,7 @@ namespace std
public:
explicit
unary_negate(const _Predicate& __x) : _M_pred(__x) {}
bool
operator()(const typename _Predicate::argument_type& __x) const
{ return !_M_pred(__x); }
@ -325,13 +325,13 @@ namespace std
/// One of the @link s20_3_5_negators negation functors@endlink.
template <class _Predicate>
inline unary_negate<_Predicate>
inline unary_negate<_Predicate>
not1(const _Predicate& __pred)
{ return unary_negate<_Predicate>(__pred); }
/// One of the @link s20_3_5_negators negation functors@endlink.
template <class _Predicate>
class binary_negate
template <class _Predicate>
class binary_negate
: public binary_function<typename _Predicate::first_argument_type,
typename _Predicate::second_argument_type,
bool>
@ -344,18 +344,18 @@ namespace std
: _M_pred(__x) { }
bool
operator()(const typename _Predicate::first_argument_type& __x,
operator()(const typename _Predicate::first_argument_type& __x,
const typename _Predicate::second_argument_type& __y) const
{ return !_M_pred(__x, __y); }
};
/// One of the @link s20_3_5_negators negation functors@endlink.
template <class _Predicate>
inline binary_negate<_Predicate>
inline binary_negate<_Predicate>
not2(const _Predicate& __pred)
{ return binary_negate<_Predicate>(__pred); }
/** @} */
// 20.3.6 binders
/** @defgroup s20_3_6_binder Binder Classes
* Binders turn functions/functors with two arguments into functors with
@ -388,7 +388,7 @@ namespace std
* @{
*/
/// One of the @link s20_3_6_binder binder functors@endlink.
template <class _Operation>
template <class _Operation>
class binder1st
: public unary_function<typename _Operation::second_argument_type,
typename _Operation::result_type>
@ -404,7 +404,7 @@ namespace std
typename _Operation::result_type
operator()(const typename _Operation::second_argument_type& __x) const
{ return op(value, __x); }
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 109. Missing binders for non-const sequence elements
typename _Operation::result_type
@ -414,15 +414,15 @@ namespace std
/// One of the @link s20_3_6_binder binder functors@endlink.
template <class _Operation, class _Tp>
inline binder1st<_Operation>
bind1st(const _Operation& __fn, const _Tp& __x)
inline binder1st<_Operation>
bind1st(const _Operation& __fn, const _Tp& __x)
{
typedef typename _Operation::first_argument_type _Arg1_type;
return binder1st<_Operation>(__fn, _Arg1_type(__x));
}
/// One of the @link s20_3_6_binder binder functors@endlink.
template <class _Operation>
template <class _Operation>
class binder2nd
: public unary_function<typename _Operation::first_argument_type,
typename _Operation::result_type>
@ -432,13 +432,13 @@ namespace std
typename _Operation::second_argument_type value;
public:
binder2nd(const _Operation& __x,
const typename _Operation::second_argument_type& __y)
const typename _Operation::second_argument_type& __y)
: op(__x), value(__y) {}
typename _Operation::result_type
operator()(const typename _Operation::first_argument_type& __x) const
{ return op(__x, value); }
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 109. Missing binders for non-const sequence elements
typename _Operation::result_type
@ -448,14 +448,14 @@ namespace std
/// One of the @link s20_3_6_binder binder functors@endlink.
template <class _Operation, class _Tp>
inline binder2nd<_Operation>
bind2nd(const _Operation& __fn, const _Tp& __x)
inline binder2nd<_Operation>
bind2nd(const _Operation& __fn, const _Tp& __x)
{
typedef typename _Operation::second_argument_type _Arg2_type;
return binder2nd<_Operation>(__fn, _Arg2_type(__x));
}
/** @} */
// 20.3.7 adaptors pointers functions
/** @defgroup s20_3_7_adaptors Adaptors for pointers to functions
* The advantage of function objects over pointers to functions is that
@ -484,7 +484,7 @@ namespace std
_Result (*_M_ptr)(_Arg);
public:
pointer_to_unary_function() {}
explicit
pointer_to_unary_function(_Result (*__x)(_Arg))
: _M_ptr(__x) {}
@ -511,7 +511,7 @@ namespace std
pointer_to_binary_function() {}
explicit
pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2))
pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2))
: _M_ptr(__x) {}
_Result
@ -521,18 +521,18 @@ namespace std
/// One of the @link s20_3_7_adaptors adaptors for function pointers@endlink.
template <class _Arg1, class _Arg2, class _Result>
inline pointer_to_binary_function<_Arg1, _Arg2, _Result>
inline pointer_to_binary_function<_Arg1, _Arg2, _Result>
ptr_fun(_Result (*__x)(_Arg1, _Arg2))
{ return pointer_to_binary_function<_Arg1, _Arg2, _Result>(__x); }
/** @} */
template <class _Tp>
struct _Identity : public unary_function<_Tp,_Tp>
{
_Tp&
operator()(_Tp& __x) const
{ return __x; }
const _Tp&
operator()(const _Tp& __x) const
{ return __x; }
@ -545,7 +545,7 @@ namespace std
typename _Pair::first_type&
operator()(_Pair& __x) const
{ return __x.first; }
const typename _Pair::first_type&
operator()(const _Pair& __x) const
{ return __x.first; }
@ -558,7 +558,7 @@ namespace std
typename _Pair::second_type&
operator()(_Pair& __x) const
{ return __x.second; }
const typename _Pair::second_type&
operator()(const _Pair& __x) const
{ return __x.second; }
@ -633,7 +633,7 @@ namespace std
private:
_Ret (_Tp::*_M_f)();
};
/// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink.
template <class _Ret, class _Tp>
class const_mem_fun_ref_t : public unary_function<_Tp, _Ret>
@ -656,7 +656,7 @@ namespace std
{
public:
explicit
mem_fun1_t(_Ret (_Tp::*__pf)(_Arg))
mem_fun1_t(_Ret (_Tp::*__pf)(_Arg))
: _M_f(__pf) {}
_Ret
@ -713,7 +713,7 @@ namespace std
private:
_Ret (_Tp::*_M_f)(_Arg) const;
};
/// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink.
template <class _Tp>
class mem_fun_t<void, _Tp> : public unary_function<_Tp*, void>
@ -729,7 +729,7 @@ namespace std
private:
void (_Tp::*_M_f)();
};
/// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink.
template <class _Tp>
class const_mem_fun_t<void, _Tp> : public unary_function<const _Tp*, void>
@ -745,7 +745,7 @@ namespace std
private:
void (_Tp::*_M_f)() const;
};
/// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink.
template <class _Tp>
class mem_fun_ref_t<void, _Tp> : public unary_function<_Tp, void>
@ -777,7 +777,7 @@ namespace std
private:
void (_Tp::*_M_f)() const;
};
/// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink.
template <class _Tp, class _Arg>
class mem_fun1_t<void, _Tp, _Arg> : public binary_function<_Tp*, _Arg, void>
@ -786,7 +786,7 @@ namespace std
explicit
mem_fun1_t(void (_Tp::*__pf)(_Arg))
: _M_f(__pf) {}
void
operator()(_Tp* __p, _Arg __x) const
{ (__p->*_M_f)(__x); }
@ -796,21 +796,21 @@ namespace std
/// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink.
template <class _Tp, class _Arg>
class const_mem_fun1_t<void, _Tp, _Arg>
class const_mem_fun1_t<void, _Tp, _Arg>
: public binary_function<const _Tp*, _Arg, void>
{
public:
explicit
const_mem_fun1_t(void (_Tp::*__pf)(_Arg) const)
: _M_f(__pf) {}
void
operator()(const _Tp* __p, _Arg __x) const
{ (__p->*_M_f)(__x); }
private:
void (_Tp::*_M_f)(_Arg) const;
};
/// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink.
template <class _Tp, class _Arg>
class mem_fun1_ref_t<void, _Tp, _Arg>
@ -856,10 +856,10 @@ namespace std
inline const_mem_fun_t<_Ret, _Tp>
mem_fun(_Ret (_Tp::*__f)() const)
{ return const_mem_fun_t<_Ret, _Tp>(__f); }
template <class _Ret, class _Tp>
inline mem_fun_ref_t<_Ret, _Tp>
mem_fun_ref(_Ret (_Tp::*__f)())
mem_fun_ref(_Ret (_Tp::*__f)())
{ return mem_fun_ref_t<_Ret, _Tp>(__f); }
template <class _Ret, class _Tp>
@ -888,7 +888,7 @@ namespace std
{ return const_mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
/** @} */
} // namespace std
#endif /* _FUNCTION_H */

View File

@ -74,7 +74,7 @@ namespace std
_Distance __parent = 0;
for (_Distance __child = 1; __child < __n; ++__child)
{
if (__first[__parent] < __first[__child])
if (__first[__parent] < __first[__child])
return false;
if ((__child & 1) == 0)
++__parent;
@ -113,7 +113,7 @@ namespace std
// Heap-manipulation functions: push_heap, pop_heap, make_heap, sort_heap.
template<typename _RandomAccessIterator, typename _Distance, typename _Tp>
void
void
__push_heap(_RandomAccessIterator __first,
_Distance __holeIndex, _Distance __topIndex, _Tp __value)
{
@ -137,7 +137,7 @@ namespace std
* range [first,last-1). After completion, [first,last) is a valid heap.
*/
template<typename _RandomAccessIterator>
inline void
inline void
push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
typedef typename iterator_traits<_RandomAccessIterator>::value_type
@ -156,7 +156,7 @@ namespace std
_DistanceType(0), _ValueType(*(__last - 1)));
}
template<typename _RandomAccessIterator, typename _Distance, typename _Tp,
template<typename _RandomAccessIterator, typename _Distance, typename _Tp,
typename _Compare>
void
__push_heap(_RandomAccessIterator __first, _Distance __holeIndex,
@ -185,7 +185,7 @@ namespace std
* Compare operations are performed using comp.
*/
template<typename _RandomAccessIterator, typename _Compare>
inline void
inline void
push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Compare __comp)
{
@ -205,7 +205,7 @@ namespace std
}
template<typename _RandomAccessIterator, typename _Distance, typename _Tp>
void
void
__adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex,
_Distance __len, _Tp __value)
{
@ -228,7 +228,7 @@ namespace std
}
template<typename _RandomAccessIterator, typename _Tp>
inline void
inline void
__pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
_RandomAccessIterator __result, _Tp __value)
{
@ -292,7 +292,7 @@ namespace std
}
template<typename _RandomAccessIterator, typename _Tp, typename _Compare>
inline void
inline void
__pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
_RandomAccessIterator __result, _Tp __value, _Compare __comp)
{
@ -315,7 +315,7 @@ namespace std
* made using comp.
*/
template<typename _RandomAccessIterator, typename _Compare>
inline void
inline void
pop_heap(_RandomAccessIterator __first,
_RandomAccessIterator __last, _Compare __comp)
{
@ -340,7 +340,7 @@ namespace std
* This operation makes the elements in [first,last) into a heap.
*/
template<typename _RandomAccessIterator>
void
void
make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
typedef typename iterator_traits<_RandomAccessIterator>::value_type
@ -357,7 +357,7 @@ namespace std
if (__last - __first < 2)
return;
const _DistanceType __len = __last - __first;
const _DistanceType __len = __last - __first;
_DistanceType __parent = (__len - 2) / 2;
while (true)
{
@ -380,7 +380,7 @@ namespace std
* Comparisons are made using comp.
*/
template<typename _RandomAccessIterator, typename _Compare>
inline void
inline void
make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Compare __comp)
{
@ -393,7 +393,7 @@ namespace std
__glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>)
__glibcxx_requires_valid_range(__first, __last);
if (__last - __first < 2)
return;
@ -444,7 +444,7 @@ namespace std
* Comparisons are made using comp.
*/
template<typename _RandomAccessIterator, typename _Compare>
void
void
sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Compare __comp)
{

View File

@ -87,7 +87,7 @@ namespace std
* the requirement that the iterators must be safe.
*/
template<typename _Iterator>
class reverse_iterator
class reverse_iterator
: public iterator<typename iterator_traits<_Iterator>::iterator_category,
typename iterator_traits<_Iterator>::value_type,
typename iterator_traits<_Iterator>::difference_type,
@ -98,9 +98,9 @@ namespace std
_Iterator current;
public:
typedef _Iterator iterator_type;
typedef typename iterator_traits<_Iterator>::difference_type
difference_type;
typedef _Iterator iterator_type;
typedef typename iterator_traits<_Iterator>::difference_type
difference_type;
typedef typename iterator_traits<_Iterator>::reference reference;
typedef typename iterator_traits<_Iterator>::pointer pointer;
@ -116,13 +116,13 @@ namespace std
/**
* This %iterator will move in the opposite direction that @p x does.
*/
explicit
explicit
reverse_iterator(iterator_type __x) : current(__x) { }
/**
* The copy constructor is normal.
*/
reverse_iterator(const reverse_iterator& __x)
reverse_iterator(const reverse_iterator& __x)
: current(__x.current) { }
/**
@ -132,11 +132,11 @@ namespace std
template<typename _Iter>
reverse_iterator(const reverse_iterator<_Iter>& __x)
: current(__x.base()) { }
/**
* @return @c current, the %iterator used for underlying work.
*/
iterator_type
iterator_type
base() const
{ return current; }
@ -145,8 +145,8 @@ namespace std
*
* @doctodo
*/
reference
operator*() const
reference
operator*() const
{
_Iterator __tmp = current;
return *--__tmp;
@ -157,7 +157,7 @@ namespace std
*
* @doctodo
*/
pointer
pointer
operator->() const
{ return &(operator*()); }
@ -166,8 +166,8 @@ namespace std
*
* @doctodo
*/
reverse_iterator&
operator++()
reverse_iterator&
operator++()
{
--current;
return *this;
@ -178,8 +178,8 @@ namespace std
*
* @doctodo
*/
reverse_iterator
operator++(int)
reverse_iterator
operator++(int)
{
reverse_iterator __tmp = *this;
--current;
@ -191,8 +191,8 @@ namespace std
*
* @doctodo
*/
reverse_iterator&
operator--()
reverse_iterator&
operator--()
{
++current;
return *this;
@ -203,20 +203,20 @@ namespace std
*
* @doctodo
*/
reverse_iterator operator--(int)
reverse_iterator operator--(int)
{
reverse_iterator __tmp = *this;
++current;
return __tmp;
}
/**
* @return TODO
*
* @doctodo
*/
reverse_iterator
operator+(difference_type __n) const
reverse_iterator
operator+(difference_type __n) const
{ return reverse_iterator(current - __n); }
/**
@ -224,8 +224,8 @@ namespace std
*
* @doctodo
*/
reverse_iterator&
operator+=(difference_type __n)
reverse_iterator&
operator+=(difference_type __n)
{
current -= __n;
return *this;
@ -236,8 +236,8 @@ namespace std
*
* @doctodo
*/
reverse_iterator
operator-(difference_type __n) const
reverse_iterator
operator-(difference_type __n) const
{ return reverse_iterator(current + __n); }
/**
@ -245,8 +245,8 @@ namespace std
*
* @doctodo
*/
reverse_iterator&
operator-=(difference_type __n)
reverse_iterator&
operator-=(difference_type __n)
{
current += __n;
return *this;
@ -257,11 +257,11 @@ namespace std
*
* @doctodo
*/
reference
reference
operator[](difference_type __n) const
{ return *(*this + __n); }
};
{ return *(*this + __n); }
};
//@{
/**
* @param x A %reverse_iterator.
@ -273,51 +273,51 @@ namespace std
*
*/
template<typename _Iterator>
inline bool
operator==(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
inline bool
operator==(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
{ return __x.base() == __y.base(); }
template<typename _Iterator>
inline bool
operator<(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
inline bool
operator<(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
{ return __y.base() < __x.base(); }
template<typename _Iterator>
inline bool
operator!=(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
inline bool
operator!=(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
{ return !(__x == __y); }
template<typename _Iterator>
inline bool
operator>(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
inline bool
operator>(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
{ return __y < __x; }
template<typename _Iterator>
inline bool
operator<=(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
inline bool
operator<=(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
{ return !(__y < __x); }
template<typename _Iterator>
inline bool
operator>=(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
inline bool
operator>=(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
{ return !(__x < __y); }
template<typename _Iterator>
inline typename reverse_iterator<_Iterator>::difference_type
operator-(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
operator-(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y)
{ return __y.base() - __x.base(); }
template<typename _Iterator>
inline reverse_iterator<_Iterator>
inline reverse_iterator<_Iterator>
operator+(typename reverse_iterator<_Iterator>::difference_type __n,
const reverse_iterator<_Iterator>& __x)
const reverse_iterator<_Iterator>& __x)
{ return reverse_iterator<_Iterator>(__x.base() - __n); }
//@}
@ -333,7 +333,7 @@ namespace std
* save typing.
*/
template<typename _Container>
class back_insert_iterator
class back_insert_iterator
: public iterator<output_iterator_tag, void, void, void, void>
{
protected:
@ -342,9 +342,9 @@ namespace std
public:
/// A nested typedef for the type of whatever container you used.
typedef _Container container_type;
/// The only way to create this %iterator is with a container.
explicit
explicit
back_insert_iterator(_Container& __x) : container(&__x) { }
/**
@ -359,19 +359,19 @@ namespace std
* always append the value to the end of the container.
*/
back_insert_iterator&
operator=(typename _Container::const_reference __value)
{
operator=(typename _Container::const_reference __value)
{
container->push_back(__value);
return *this;
}
/// Simply returns *this.
back_insert_iterator&
back_insert_iterator&
operator*()
{ return *this; }
/// Simply returns *this. (This %iterator does not "move".)
back_insert_iterator&
back_insert_iterator&
operator++()
{ return *this; }
@ -393,8 +393,8 @@ namespace std
* types for you.
*/
template<typename _Container>
inline back_insert_iterator<_Container>
back_inserter(_Container& __x)
inline back_insert_iterator<_Container>
back_inserter(_Container& __x)
{ return back_insert_iterator<_Container>(__x); }
/**
@ -408,7 +408,7 @@ namespace std
* save typing.
*/
template<typename _Container>
class front_insert_iterator
class front_insert_iterator
: public iterator<output_iterator_tag, void, void, void, void>
{
protected:
@ -433,24 +433,24 @@ namespace std
* always prepend the value to the front of the container.
*/
front_insert_iterator&
operator=(typename _Container::const_reference __value)
{
operator=(typename _Container::const_reference __value)
{
container->push_front(__value);
return *this;
}
/// Simply returns *this.
front_insert_iterator&
front_insert_iterator&
operator*()
{ return *this; }
/// Simply returns *this. (This %iterator does not "move".)
front_insert_iterator&
front_insert_iterator&
operator++()
{ return *this; }
/// Simply returns *this. (This %iterator does not "move".)
front_insert_iterator
front_insert_iterator
operator++(int)
{ return *this; }
};
@ -467,8 +467,8 @@ namespace std
* types for you.
*/
template<typename _Container>
inline front_insert_iterator<_Container>
front_inserter(_Container& __x)
inline front_insert_iterator<_Container>
front_inserter(_Container& __x)
{ return front_insert_iterator<_Container>(__x); }
/**
@ -486,7 +486,7 @@ namespace std
* save typing.
*/
template<typename _Container>
class insert_iterator
class insert_iterator
: public iterator<output_iterator_tag, void, void, void, void>
{
protected:
@ -496,14 +496,14 @@ namespace std
public:
/// A nested typedef for the type of whatever container you used.
typedef _Container container_type;
/**
* The only way to create this %iterator is with a container and an
* initial position (a normal %iterator into the container).
*/
insert_iterator(_Container& __x, typename _Container::iterator __i)
insert_iterator(_Container& __x, typename _Container::iterator __i)
: container(&__x), iter(__i) {}
/**
* @param value An instance of whatever type
* container_type::const_reference is; presumably a
@ -528,29 +528,29 @@ namespace std
* @endcode
*/
insert_iterator&
operator=(const typename _Container::const_reference __value)
{
operator=(const typename _Container::const_reference __value)
{
iter = container->insert(iter, __value);
++iter;
return *this;
}
/// Simply returns *this.
insert_iterator&
insert_iterator&
operator*()
{ return *this; }
/// Simply returns *this. (This %iterator does not "move".)
insert_iterator&
insert_iterator&
operator++()
{ return *this; }
/// Simply returns *this. (This %iterator does not "move".)
insert_iterator&
insert_iterator&
operator++(int)
{ return *this; }
};
/**
* @param x A container of arbitrary type.
* @return An instance of insert_iterator working on @p x.
@ -563,16 +563,16 @@ namespace std
* types for you.
*/
template<typename _Container, typename _Iterator>
inline insert_iterator<_Container>
inline insert_iterator<_Container>
inserter(_Container& __x, _Iterator __i)
{
return insert_iterator<_Container>(__x,
return insert_iterator<_Container>(__x,
typename _Container::iterator(__i));
}
} // namespace std
namespace __gnu_cxx
{
{
// This iterator adapter is 'normal' in the sense that it does not
// change the semantics of any of the operators of its iterator
// parameter. Its primary purpose is to convert an iterator that is
@ -587,19 +587,19 @@ namespace __gnu_cxx
{
protected:
_Iterator _M_current;
public:
typedef typename iterator_traits<_Iterator>::iterator_category
iterator_category;
typedef typename iterator_traits<_Iterator>::value_type value_type;
typedef typename iterator_traits<_Iterator>::difference_type
typedef typename iterator_traits<_Iterator>::difference_type
difference_type;
typedef typename iterator_traits<_Iterator>::reference reference;
typedef typename iterator_traits<_Iterator>::pointer pointer;
__normal_iterator() : _M_current(_Iterator()) { }
explicit
explicit
__normal_iterator(const _Iterator& __i) : _M_current(__i) { }
// Allow iterator to const_iterator conversion
@ -612,22 +612,22 @@ namespace __gnu_cxx
reference
operator*() const
{ return *_M_current; }
pointer
operator->() const
{ return _M_current; }
__normal_iterator&
operator++()
{
++_M_current;
return *this;
}
__normal_iterator
operator++(int)
{ return __normal_iterator(_M_current++); }
// Bidirectional iterator requirements
__normal_iterator&
operator--()
@ -635,16 +635,16 @@ namespace __gnu_cxx
--_M_current;
return *this;
}
__normal_iterator
operator--(int)
{ return __normal_iterator(_M_current--); }
// Random access iterator requirements
reference
operator[](const difference_type& __n) const
{ return _M_current[__n]; }
__normal_iterator&
operator+=(const difference_type& __n)
{ _M_current += __n; return *this; }
@ -652,16 +652,16 @@ namespace __gnu_cxx
__normal_iterator
operator+(const difference_type& __n) const
{ return __normal_iterator(_M_current + __n); }
__normal_iterator&
operator-=(const difference_type& __n)
{ _M_current -= __n; return *this; }
__normal_iterator
operator-(const difference_type& __n) const
{ return __normal_iterator(_M_current - __n); }
const _Iterator&
const _Iterator&
base() const
{ return _M_current; }
};
@ -673,7 +673,7 @@ namespace __gnu_cxx
// will make overload resolution ambiguous (when in scope) if we don't
// provide overloads whose operands are of the same type. Can someone
// remind me what generic programming is about? -- Gaby
// Forward iterator requirements
template<typename _IteratorL, typename _IteratorR, typename _Container>
inline bool
@ -701,7 +701,7 @@ namespace __gnu_cxx
// Random access iterator requirements
template<typename _IteratorL, typename _IteratorR, typename _Container>
inline bool
inline bool
operator<(const __normal_iterator<_IteratorL, _Container>& __lhs,
const __normal_iterator<_IteratorR, _Container>& __rhs)
{ return __lhs.base() < __rhs.base(); }
@ -765,7 +765,7 @@ namespace __gnu_cxx
{ return __normal_iterator<_Iterator, _Container>(__i.base() + __n); }
} // namespace __gnu_cxx
#endif
#endif
// Local Variables:
// mode:C++

View File

@ -76,7 +76,7 @@ namespace std
{
// concept requirements
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
typename iterator_traits<_InputIterator>::difference_type __n = 0;
while (__first != __last)
{
@ -85,7 +85,7 @@ namespace std
}
return __n;
}
template<typename _RandomAccessIterator>
inline typename iterator_traits<_RandomAccessIterator>::difference_type
__distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
@ -96,7 +96,7 @@ namespace std
_RandomAccessIterator>)
return __last - __first;
}
/**
* @brief A generalization of pointer arithmetic.
* @param first An input iterator.
@ -117,7 +117,7 @@ namespace std
return std::__distance(__first, __last,
std::__iterator_category(__first));
}
template<typename _InputIterator, typename _Distance>
inline void
__advance(_InputIterator& __i, _Distance __n, input_iterator_tag)
@ -127,7 +127,7 @@ namespace std
while (__n--)
++__i;
}
template<typename _BidirectionalIterator, typename _Distance>
inline void
__advance(_BidirectionalIterator& __i, _Distance __n,
@ -143,7 +143,7 @@ namespace std
while (__n++)
--__i;
}
template<typename _RandomAccessIterator, typename _Distance>
inline void
__advance(_RandomAccessIterator& __i, _Distance __n,
@ -154,7 +154,7 @@ namespace std
_RandomAccessIterator>)
__i += __n;
}
/**
* @brief A generalization of pointer arithmetic.
* @param i An input iterator.

View File

@ -69,7 +69,7 @@ namespace __gnu_norm
// latter publicly inherits from the former in an effort to reduce code
// duplication. This results in some "needless" static_cast'ing later on,
// but it's all safe downcasting.
/// @if maint Common part of a node in the %list. @endif
struct _List_node_base
{
@ -88,18 +88,18 @@ namespace __gnu_norm
void
hook(_List_node_base * const __position);
void
unhook();
};
/// @if maint An actual node in the %list. @endif
template<typename _Tp>
struct _List_node : public _List_node_base
{
_Tp _M_data; ///< User's data.
};
/**
* @brief A list::iterator.
*
@ -112,13 +112,13 @@ namespace __gnu_norm
{
typedef _List_iterator<_Tp> _Self;
typedef _List_node<_Tp> _Node;
typedef ptrdiff_t difference_type;
typedef bidirectional_iterator_tag iterator_category;
typedef _Tp value_type;
typedef _Tp* pointer;
typedef _Tp& reference;
_List_iterator() { }
_List_iterator(_List_node_base* __x)
@ -132,14 +132,14 @@ namespace __gnu_norm
pointer
operator->() const
{ return &static_cast<_Node*>(_M_node)->_M_data; }
_Self&
operator++()
{
_M_node = _M_node->_M_next;
return *this;
}
_Self
operator++(int)
{
@ -147,14 +147,14 @@ namespace __gnu_norm
_M_node = _M_node->_M_next;
return __tmp;
}
_Self&
operator--()
{
_M_node = _M_node->_M_prev;
return *this;
}
_Self
operator--(int)
{
@ -162,7 +162,7 @@ namespace __gnu_norm
_M_node = _M_node->_M_prev;
return __tmp;
}
bool
operator==(const _Self& __x) const
{ return _M_node == __x._M_node; }
@ -170,11 +170,11 @@ namespace __gnu_norm
bool
operator!=(const _Self& __x) const
{ return _M_node != __x._M_node; }
// The only member points to the %list element.
_List_node_base* _M_node;
};
/**
* @brief A list::const_iterator.
*
@ -188,13 +188,13 @@ namespace __gnu_norm
typedef _List_const_iterator<_Tp> _Self;
typedef const _List_node<_Tp> _Node;
typedef _List_iterator<_Tp> iterator;
typedef ptrdiff_t difference_type;
typedef bidirectional_iterator_tag iterator_category;
typedef _Tp value_type;
typedef const _Tp* pointer;
typedef const _Tp& reference;
_List_const_iterator() { }
_List_const_iterator(const _List_node_base* __x)
@ -212,14 +212,14 @@ namespace __gnu_norm
pointer
operator->() const
{ return &static_cast<_Node*>(_M_node)->_M_data; }
_Self&
operator++()
{
_M_node = _M_node->_M_next;
return *this;
}
_Self
operator++(int)
{
@ -227,14 +227,14 @@ namespace __gnu_norm
_M_node = _M_node->_M_next;
return __tmp;
}
_Self&
operator--()
{
_M_node = _M_node->_M_prev;
return *this;
}
_Self
operator--(int)
{
@ -242,32 +242,32 @@ namespace __gnu_norm
_M_node = _M_node->_M_prev;
return __tmp;
}
bool
operator==(const _Self& __x) const
{ return _M_node == __x._M_node; }
bool
operator!=(const _Self& __x) const
{ return _M_node != __x._M_node; }
// The only member points to the %list element.
const _List_node_base* _M_node;
};
template<typename _Val>
inline bool
operator==(const _List_iterator<_Val>& __x,
const _List_const_iterator<_Val>& __y)
inline bool
operator==(const _List_iterator<_Val>& __x,
const _List_const_iterator<_Val>& __y)
{ return __x._M_node == __y._M_node; }
template<typename _Val>
inline bool
inline bool
operator!=(const _List_iterator<_Val>& __x,
const _List_const_iterator<_Val>& __y)
const _List_const_iterator<_Val>& __y)
{ return __x._M_node != __y._M_node; }
/**
* @if maint
* See bits/stl_deque.h's _Deque_base for an explanation.
@ -300,7 +300,7 @@ namespace __gnu_norm
_List_node<_Tp>*
_M_get_node()
{ return _Node_Alloc_type::allocate(1); }
void
_M_put_node(_List_node<_Tp>* __p)
{ _Node_Alloc_type::deallocate(__p, 1); }
@ -308,18 +308,18 @@ namespace __gnu_norm
public:
typedef _Alloc allocator_type;
allocator_type
allocator_type
get_allocator() const
{ return allocator_type(*static_cast<const _Node_Alloc_type*>(this)); }
_List_base(const allocator_type& __a)
: _Node_Alloc_type(__a)
{ _M_init(); }
// This is what actually destroys the list.
~_List_base()
{ _M_clear(); }
void
_M_clear();
@ -330,7 +330,7 @@ namespace __gnu_norm
this->_M_node._M_prev = &this->_M_node;
}
};
/**
* @brief A standard container with linear time access to elements,
* and fixed time insertion/deletion at any point in the sequence.
@ -381,9 +381,9 @@ namespace __gnu_norm
{
// concept requirements
__glibcxx_class_requires(_Tp, _SGIAssignableConcept)
typedef _List_base<_Tp, _Alloc> _Base;
public:
typedef _Tp value_type;
typedef value_type* pointer;
@ -397,12 +397,12 @@ namespace __gnu_norm
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef typename _Base::allocator_type allocator_type;
protected:
// Note that pointers-to-_Node's can be ctor-converted to
// iterator types.
typedef _List_node<_Tp> _Node;
typedef _List_node<_Tp> _Node;
/** @if maint
* One data member plus two memory-handling functions. If the
* _Alloc type requires separate instances, then one of those
@ -412,7 +412,7 @@ namespace __gnu_norm
using _Base::_M_node;
using _Base::_M_put_node;
using _Base::_M_get_node;
/**
* @if maint
* @param x An instance of user data.
@ -424,7 +424,7 @@ namespace __gnu_norm
_M_create_node(const value_type& __x)
{
_Node* __p = this->_M_get_node();
try
try
{
std::_Construct(&__p->_M_data, __x);
}
@ -435,7 +435,7 @@ namespace __gnu_norm
}
return __p;
}
/**
* @if maint
* Allocates space for a new node and default-constructs a new
@ -446,7 +446,7 @@ namespace __gnu_norm
_M_create_node()
{
_Node* __p = this->_M_get_node();
try
try
{
std::_Construct(&__p->_M_data);
}
@ -457,7 +457,7 @@ namespace __gnu_norm
}
return __p;
}
public:
// [23.2.2.1] construct/copy/destroy
// (assign() and get_allocator() are also listed in this section)
@ -467,23 +467,23 @@ namespace __gnu_norm
explicit
list(const allocator_type& __a = allocator_type())
: _Base(__a) { }
/**
* @brief Create a %list with copies of an exemplar element.
* @param n The number of elements to initially create.
* @param value An element to copy.
*
*
* This constructor fills the %list with @a n copies of @a value.
*/
list(size_type __n, const value_type& __value,
const allocator_type& __a = allocator_type())
: _Base(__a)
{ this->insert(begin(), __n, __value); }
/**
* @brief Create a %list with default elements.
* @param n The number of elements to initially create.
*
*
* This constructor fills the %list with @a n copies of a
* default-constructed element.
*/
@ -491,23 +491,23 @@ namespace __gnu_norm
list(size_type __n)
: _Base(allocator_type())
{ this->insert(begin(), __n, value_type()); }
/**
* @brief %List copy constructor.
* @param x A %list of identical element and allocator types.
*
*
* The newly-created %list uses a copy of the allocation object used
* by @a x.
*/
list(const list& __x)
: _Base(__x.get_allocator())
{ this->insert(begin(), __x.begin(), __x.end()); }
/**
* @brief Builds a %list from a range.
* @param first An input iterator.
* @param last An input iterator.
*
*
* Create a %list consisting of copies of the elements from
* [@a first,@a last). This is linear in N (where N is
* distance(@a first,@a last)).
@ -522,7 +522,7 @@ namespace __gnu_norm
const allocator_type& __a = allocator_type())
: _Base(__a)
{ this->insert(begin(), __first, __last); }
/**
* No explicit dtor needed as the _Base dtor takes care of
* things. The _Base dtor only erases the elements, and note
@ -530,17 +530,17 @@ namespace __gnu_norm
* memory is not touched in any way. Managing the pointer is
* the user's responsibilty.
*/
/**
* @brief %List assignment operator.
* @param x A %list of identical element and allocator types.
*
*
* All the elements of @a x are copied, but unlike the copy
* constructor, the allocator object is not copied.
*/
list&
operator=(const list& __x);
/**
* @brief Assigns a given value to a %list.
* @param n Number of elements to be assigned.
@ -552,9 +552,9 @@ namespace __gnu_norm
* of elements assigned. Old data may be lost.
*/
void
assign(size_type __n, const value_type& __val)
assign(size_type __n, const value_type& __val)
{ _M_fill_assign(__n, __val); }
/**
* @brief Assigns a range to a %list.
* @param first An input iterator.
@ -570,17 +570,17 @@ namespace __gnu_norm
template<typename _InputIterator>
void
assign(_InputIterator __first, _InputIterator __last)
{
{
// Check whether it's an integral type. If so, it's not an iterator.
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_assign_dispatch(__first, __last, _Integral());
}
/// Get a copy of the memory allocation object.
allocator_type
get_allocator() const
{ return _Base::get_allocator(); }
// iterators
/**
* Returns a read/write iterator that points to the first element in the
@ -589,7 +589,7 @@ namespace __gnu_norm
iterator
begin()
{ return this->_M_node._M_next; }
/**
* Returns a read-only (constant) iterator that points to the
* first element in the %list. Iteration is done in ordinary
@ -598,7 +598,7 @@ namespace __gnu_norm
const_iterator
begin() const
{ return this->_M_node._M_next; }
/**
* Returns a read/write iterator that points one past the last
* element in the %list. Iteration is done in ordinary element
@ -606,7 +606,7 @@ namespace __gnu_norm
*/
iterator
end() { return &this->_M_node; }
/**
* Returns a read-only (constant) iterator that points one past
* the last element in the %list. Iteration is done in ordinary
@ -615,7 +615,7 @@ namespace __gnu_norm
const_iterator
end() const
{ return &this->_M_node; }
/**
* Returns a read/write reverse iterator that points to the last
* element in the %list. Iteration is done in reverse element
@ -624,7 +624,7 @@ namespace __gnu_norm
reverse_iterator
rbegin()
{ return reverse_iterator(end()); }
/**
* Returns a read-only (constant) reverse iterator that points to
* the last element in the %list. Iteration is done in reverse
@ -633,7 +633,7 @@ namespace __gnu_norm
const_reverse_iterator
rbegin() const
{ return const_reverse_iterator(end()); }
/**
* Returns a read/write reverse iterator that points to one
* before the first element in the %list. Iteration is done in
@ -642,7 +642,7 @@ namespace __gnu_norm
reverse_iterator
rend()
{ return reverse_iterator(begin()); }
/**
* Returns a read-only (constant) reverse iterator that points to one
* before the first element in the %list. Iteration is done in reverse
@ -651,7 +651,7 @@ namespace __gnu_norm
const_reverse_iterator
rend() const
{ return const_reverse_iterator(begin()); }
// [23.2.2.2] capacity
/**
* Returns true if the %list is empty. (Thus begin() would equal
@ -660,17 +660,17 @@ namespace __gnu_norm
bool
empty() const
{ return this->_M_node._M_next == &this->_M_node; }
/** Returns the number of elements in the %list. */
size_type
size() const
{ return std::distance(begin(), end()); }
/** Returns the size() of the largest possible %list. */
size_type
max_size() const
{ return size_type(-1); }
/**
* @brief Resizes the %list to the specified number of elements.
* @param new_size Number of elements the %list should contain.
@ -683,7 +683,7 @@ namespace __gnu_norm
*/
void
resize(size_type __new_size, const value_type& __x);
/**
* @brief Resizes the %list to the specified number of elements.
* @param new_size Number of elements the %list should contain.
@ -696,7 +696,7 @@ namespace __gnu_norm
void
resize(size_type __new_size)
{ this->resize(__new_size, value_type()); }
// element access
/**
* Returns a read/write reference to the data at the first
@ -705,7 +705,7 @@ namespace __gnu_norm
reference
front()
{ return *begin(); }
/**
* Returns a read-only (constant) reference to the data at the first
* element of the %list.
@ -713,7 +713,7 @@ namespace __gnu_norm
const_reference
front() const
{ return *begin(); }
/**
* Returns a read/write reference to the data at the last element
* of the %list.
@ -721,7 +721,7 @@ namespace __gnu_norm
reference
back()
{ return *(--end()); }
/**
* Returns a read-only (constant) reference to the data at the last
* element of the %list.
@ -729,7 +729,7 @@ namespace __gnu_norm
const_reference
back() const
{ return *(--end()); }
// [23.2.2.3] modifiers
/**
* @brief Add data to the front of the %list.
@ -744,7 +744,7 @@ namespace __gnu_norm
void
push_front(const value_type& __x)
{ this->_M_insert(begin(), __x); }
/**
* @brief Removes first element.
*
@ -760,7 +760,7 @@ namespace __gnu_norm
void
pop_front()
{ this->_M_erase(begin()); }
/**
* @brief Add data to the end of the %list.
* @param x Data to be added.
@ -774,7 +774,7 @@ namespace __gnu_norm
void
push_back(const value_type& __x)
{ this->_M_insert(end(), __x); }
/**
* @brief Removes last element.
*
@ -789,7 +789,7 @@ namespace __gnu_norm
void
pop_back()
{ this->_M_erase(this->_M_node._M_prev); }
/**
* @brief Inserts given value into %list before specified iterator.
* @param position An iterator into the %list.
@ -803,7 +803,7 @@ namespace __gnu_norm
*/
iterator
insert(iterator __position, const value_type& __x);
/**
* @brief Inserts a number of copies of given data into the %list.
* @param position An iterator into the %list.
@ -820,7 +820,7 @@ namespace __gnu_norm
void
insert(iterator __position, size_type __n, const value_type& __x)
{ _M_fill_insert(__position, __n, __x); }
/**
* @brief Inserts a range into the %list.
* @param position An iterator into the %list.
@ -837,14 +837,14 @@ namespace __gnu_norm
*/
template<typename _InputIterator>
void
insert(iterator __position, _InputIterator __first,
insert(iterator __position, _InputIterator __first,
_InputIterator __last)
{
// Check whether it's an integral type. If so, it's not an iterator.
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_insert_dispatch(__position, __first, __last, _Integral());
}
/**
* @brief Remove element at given position.
* @param position Iterator pointing to element to be erased.
@ -862,7 +862,7 @@ namespace __gnu_norm
*/
iterator
erase(iterator __position);
/**
* @brief Remove a range of elements.
* @param first Iterator pointing to the first element to be erased.
@ -889,7 +889,7 @@ namespace __gnu_norm
__first = erase(__first);
return __last;
}
/**
* @brief Swaps data with another %list.
* @param x A %list of the same element and allocator types.
@ -902,7 +902,7 @@ namespace __gnu_norm
void
swap(list& __x)
{ _List_node_base::swap(this->_M_node,__x._M_node); }
/**
* Erases all the elements. Note that this function only erases
* the elements, and that if the elements themselves are
@ -915,7 +915,7 @@ namespace __gnu_norm
_Base::_M_clear();
_Base::_M_init();
}
// [23.2.2.4] list operations
/**
* @brief Insert contents of another %list.
@ -932,7 +932,7 @@ namespace __gnu_norm
if (!__x.empty())
this->_M_transfer(__position, __x.begin(), __x.end());
}
/**
* @brief Insert element from another %list.
* @param position Iterator referencing the element to insert before.
@ -951,7 +951,7 @@ namespace __gnu_norm
return;
this->_M_transfer(__position, __i, __j);
}
/**
* @brief Insert range from another %list.
* @param position Iterator referencing the element to insert before.
@ -970,7 +970,7 @@ namespace __gnu_norm
if (__first != __last)
this->_M_transfer(__position, __first, __last);
}
/**
* @brief Remove all elements equal to value.
* @param value The value to remove.
@ -984,7 +984,7 @@ namespace __gnu_norm
*/
void
remove(const _Tp& __value);
/**
* @brief Remove all elements satisfying a predicate.
* @param Predicate Unary predicate function or object.
@ -999,7 +999,7 @@ namespace __gnu_norm
template<typename _Predicate>
void
remove_if(_Predicate);
/**
* @brief Remove consecutive duplicate elements.
*
@ -1012,7 +1012,7 @@ namespace __gnu_norm
*/
void
unique();
/**
* @brief Remove consecutive elements satisfying a predicate.
* @param BinaryPredicate Binary predicate function or object.
@ -1028,7 +1028,7 @@ namespace __gnu_norm
template<typename _BinaryPredicate>
void
unique(_BinaryPredicate);
/**
* @brief Merge sorted lists.
* @param x Sorted list to merge.
@ -1040,7 +1040,7 @@ namespace __gnu_norm
*/
void
merge(list& __x);
/**
* @brief Merge sorted lists according to comparison function.
* @param x Sorted list to merge.
@ -1056,7 +1056,7 @@ namespace __gnu_norm
template<typename _StrictWeakOrdering>
void
merge(list&, _StrictWeakOrdering);
/**
* @brief Reverse the elements in list.
*
@ -1065,7 +1065,7 @@ namespace __gnu_norm
void
reverse()
{ this->_M_node.reverse(); }
/**
* @brief Sort the elements.
*
@ -1074,7 +1074,7 @@ namespace __gnu_norm
*/
void
sort();
/**
* @brief Sort the elements according to comparison function.
*
@ -1084,10 +1084,10 @@ namespace __gnu_norm
template<typename _StrictWeakOrdering>
void
sort(_StrictWeakOrdering);
protected:
// Internal assign functions follow.
// Called by the range assign to implement [23.1.1]/9
template<typename _Integer>
void
@ -1096,21 +1096,21 @@ namespace __gnu_norm
_M_fill_assign(static_cast<size_type>(__n),
static_cast<value_type>(__val));
}
// Called by the range assign to implement [23.1.1]/9
template<typename _InputIterator>
void
_M_assign_dispatch(_InputIterator __first, _InputIterator __last,
_M_assign_dispatch(_InputIterator __first, _InputIterator __last,
__false_type);
// Called by assign(n,t), and the range assign when it turns out
// to be the same thing.
void
_M_fill_assign(size_type __n, const value_type& __val);
// Internal insert functions follow.
// Called by the range insert to implement [23.1.1]/9
template<typename _Integer>
void
@ -1120,7 +1120,7 @@ namespace __gnu_norm
_M_fill_insert(__pos, static_cast<size_type>(__n),
static_cast<value_type>(__x));
}
// Called by the range insert to implement [23.1.1]/9
template<typename _InputIterator>
void
@ -1131,7 +1131,7 @@ namespace __gnu_norm
for ( ; __first != __last; ++__first)
_M_insert(__pos, *__first);
}
// Called by insert(p,n,x), and the range insert when it turns out
// to be the same thing.
void
@ -1140,8 +1140,8 @@ namespace __gnu_norm
for ( ; __n > 0; --__n)
_M_insert(__pos, __x);
}
// Moves the elements from [first,last) before position.
void
_M_transfer(iterator __position, iterator __first, iterator __last)
@ -1165,7 +1165,7 @@ namespace __gnu_norm
_M_put_node(__n);
}
};
/**
* @brief List equality comparison.
* @param x A %list.
@ -1183,17 +1183,17 @@ namespace __gnu_norm
typedef typename list<_Tp,_Alloc>::const_iterator const_iterator;
const_iterator __end1 = __x.end();
const_iterator __end2 = __y.end();
const_iterator __i1 = __x.begin();
const_iterator __i2 = __y.begin();
while (__i1 != __end1 && __i2 != __end2 && *__i1 == *__i2)
while (__i1 != __end1 && __i2 != __end2 && *__i1 == *__i2)
{
++__i1;
++__i2;
}
return __i1 == __end1 && __i2 == __end2;
}
/**
* @brief List ordering relation.
* @param x A %list.
@ -1210,31 +1210,31 @@ namespace __gnu_norm
operator<(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y)
{ return std::lexicographical_compare(__x.begin(), __x.end(),
__y.begin(), __y.end()); }
/// Based on operator==
template<typename _Tp, typename _Alloc>
inline bool
operator!=(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y)
{ return !(__x == __y); }
/// Based on operator<
template<typename _Tp, typename _Alloc>
inline bool
operator>(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y)
{ return __y < __x; }
/// Based on operator<
template<typename _Tp, typename _Alloc>
inline bool
operator<=(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y)
{ return !(__y < __x); }
/// Based on operator<
template<typename _Tp, typename _Alloc>
inline bool
operator>=(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y)
{ return !(__x < __y); }
/// See std::list::swap().
template<typename _Tp, typename _Alloc>
inline void

View File

@ -94,35 +94,35 @@ namespace __gnu_norm
__glibcxx_class_requires(_Tp, _SGIAssignableConcept)
__glibcxx_class_requires4(_Compare, bool, _Key, _Key,
_BinaryFunctionConcept)
public:
typedef _Key key_type;
typedef _Tp mapped_type;
typedef pair<const _Key, _Tp> value_type;
typedef _Compare key_compare;
class value_compare
: public binary_function<value_type, value_type, bool>
{
friend class map<_Key,_Tp,_Compare,_Alloc>;
protected:
_Compare comp;
value_compare(_Compare __c)
: comp(__c) { }
public:
bool operator()(const value_type& __x, const value_type& __y) const
{ return comp(__x.first, __y.first); }
};
private:
/// @if maint This turns a red-black tree into a [multi]map. @endif
typedef _Rb_tree<key_type, value_type,
_Select1st<value_type>, key_compare, _Alloc> _Rep_type;
/// @if maint The actual tree structure. @endif
_Rep_type _M_t;
public:
// many of these are specified differently in ISO, but the following are
// "functionally equivalent"
@ -137,7 +137,7 @@ namespace __gnu_norm
typedef typename _Rep_type::const_pointer const_pointer;
typedef typename _Rep_type::reverse_iterator reverse_iterator;
typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
// [23.3.1.1] construct/copy/destroy
// (get_allocator() is normally listed in this section, but seems to have
// been accidentally omitted in the printed standard)
@ -146,7 +146,7 @@ namespace __gnu_norm
*/
map()
: _M_t(_Compare(), allocator_type()) { }
// for some reason this was made a separate function
/**
* @brief Default constructor creates no elements.
@ -154,7 +154,7 @@ namespace __gnu_norm
explicit
map(const _Compare& __comp, const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { }
/**
* @brief Map copy constructor.
* @param x A %map of identical element and allocator types.
@ -164,7 +164,7 @@ namespace __gnu_norm
*/
map(const map& __x)
: _M_t(__x._M_t) { }
/**
* @brief Builds a %map from a range.
* @param first An input iterator.
@ -178,7 +178,7 @@ namespace __gnu_norm
map(_InputIterator __first, _InputIterator __last)
: _M_t(_Compare(), allocator_type())
{ _M_t.insert_unique(__first, __last); }
/**
* @brief Builds a %map from a range.
* @param first An input iterator.
@ -195,7 +195,7 @@ namespace __gnu_norm
const _Compare& __comp, const allocator_type& __a = allocator_type())
: _M_t(__comp, __a)
{ _M_t.insert_unique(__first, __last); }
// FIXME There is no dtor declared, but we should have something generated
// by Doxygen. I don't know what tags to add to this paragraph to make
// that happen:
@ -204,7 +204,7 @@ namespace __gnu_norm
* themselves are pointers, the pointed-to memory is not touched in any
* way. Managing the pointer is the user's responsibilty.
*/
/**
* @brief Map assignment operator.
* @param x A %map of identical element and allocator types.
@ -218,22 +218,22 @@ namespace __gnu_norm
_M_t = __x._M_t;
return *this;
}
/// Get a copy of the memory allocation object.
allocator_type
get_allocator() const
{ return _M_t.get_allocator(); }
// iterators
/**
* Returns a read/write iterator that points to the first pair in the
* Returns a read/write iterator that points to the first pair in the
* %map.
* Iteration is done in ascending order according to the keys.
*/
iterator
begin()
{ return _M_t.begin(); }
/**
* Returns a read-only (constant) iterator that points to the first pair
* in the %map. Iteration is done in ascending order according to the
@ -242,7 +242,7 @@ namespace __gnu_norm
const_iterator
begin() const
{ return _M_t.begin(); }
/**
* Returns a read/write iterator that points one past the last pair in
* the %map. Iteration is done in ascending order according to the keys.
@ -250,7 +250,7 @@ namespace __gnu_norm
iterator
end()
{ return _M_t.end(); }
/**
* Returns a read-only (constant) iterator that points one past the last
* pair in the %map. Iteration is done in ascending order according to
@ -259,7 +259,7 @@ namespace __gnu_norm
const_iterator
end() const
{ return _M_t.end(); }
/**
* Returns a read/write reverse iterator that points to the last pair in
* the %map. Iteration is done in descending order according to the
@ -268,7 +268,7 @@ namespace __gnu_norm
reverse_iterator
rbegin()
{ return _M_t.rbegin(); }
/**
* Returns a read-only (constant) reverse iterator that points to the
* last pair in the %map. Iteration is done in descending order
@ -277,7 +277,7 @@ namespace __gnu_norm
const_reverse_iterator
rbegin() const
{ return _M_t.rbegin(); }
/**
* Returns a read/write reverse iterator that points to one before the
* first pair in the %map. Iteration is done in descending order
@ -286,7 +286,7 @@ namespace __gnu_norm
reverse_iterator
rend()
{ return _M_t.rend(); }
/**
* Returns a read-only (constant) reverse iterator that points to one
* before the first pair in the %map. Iteration is done in descending
@ -295,7 +295,7 @@ namespace __gnu_norm
const_reverse_iterator
rend() const
{ return _M_t.rend(); }
// capacity
/** Returns true if the %map is empty. (Thus begin() would equal
* end().)
@ -303,17 +303,17 @@ namespace __gnu_norm
bool
empty() const
{ return _M_t.empty(); }
/** Returns the size of the %map. */
size_type
size() const
{ return _M_t.size(); }
/** Returns the maximum size of the %map. */
size_type
max_size() const
{ return _M_t.max_size(); }
// [23.3.1.2] element access
/**
* @brief Subscript ( @c [] ) access to %map data.
@ -332,14 +332,14 @@ namespace __gnu_norm
{
// concept requirements
__glibcxx_function_requires(_DefaultConstructibleConcept<mapped_type>)
iterator __i = lower_bound(__k);
// __i->first is greater than or equivalent to __k.
if (__i == end() || key_comp()(__k, (*__i).first))
__i = insert(__i, value_type(__k, mapped_type()));
return (*__i).second;
}
// modifiers
/**
* @brief Attempts to insert a std::pair into the %map.
@ -358,7 +358,7 @@ namespace __gnu_norm
pair<iterator,bool>
insert(const value_type& __x)
{ return _M_t.insert_unique(__x); }
/**
* @brief Attempts to insert a std::pair into the %map.
* @param position An iterator that serves as a hint as to where the
@ -382,7 +382,7 @@ namespace __gnu_norm
iterator
insert(iterator position, const value_type& __x)
{ return _M_t.insert_unique(position, __x); }
/**
* @brief A template function that attemps to insert a range of elements.
* @param first Iterator pointing to the start of the range to be
@ -395,7 +395,7 @@ namespace __gnu_norm
void
insert(_InputIterator __first, _InputIterator __last)
{ _M_t.insert_unique(__first, __last); }
/**
* @brief Erases an element from a %map.
* @param position An iterator pointing to the element to be erased.
@ -408,7 +408,7 @@ namespace __gnu_norm
void
erase(iterator __position)
{ _M_t.erase(__position); }
/**
* @brief Erases elements according to the provided key.
* @param x Key of element to be erased.
@ -423,7 +423,7 @@ namespace __gnu_norm
size_type
erase(const key_type& __x)
{ return _M_t.erase(__x); }
/**
* @brief Erases a [first,last) range of elements from a %map.
* @param first Iterator pointing to the start of the range to be
@ -438,7 +438,7 @@ namespace __gnu_norm
void
erase(iterator __first, iterator __last)
{ _M_t.erase(__first, __last); }
/**
* @brief Swaps data with another %map.
* @param x A %map of the same element and allocator types.
@ -453,7 +453,7 @@ namespace __gnu_norm
void
swap(map& __x)
{ _M_t.swap(__x._M_t); }
/**
* Erases all elements in a %map. Note that this function only erases
* the elements, and that if the elements themselves are pointers, the
@ -463,7 +463,7 @@ namespace __gnu_norm
void
clear()
{ _M_t.clear(); }
// observers
/**
* Returns the key comparison object out of which the %map was
@ -472,7 +472,7 @@ namespace __gnu_norm
key_compare
key_comp() const
{ return _M_t.key_comp(); }
/**
* Returns a value comparison object, built from the key comparison
* object out of which the %map was constructed.
@ -480,7 +480,7 @@ namespace __gnu_norm
value_compare
value_comp() const
{ return value_compare(_M_t.key_comp()); }
// [23.3.1.3] map operations
/**
* @brief Tries to locate an element in a %map.
@ -496,7 +496,7 @@ namespace __gnu_norm
iterator
find(const key_type& __x)
{ return _M_t.find(__x); }
/**
* @brief Tries to locate an element in a %map.
* @param x Key of (key, value) %pair to be located.
@ -511,7 +511,7 @@ namespace __gnu_norm
const_iterator
find(const key_type& __x) const
{ return _M_t.find(__x); }
/**
* @brief Finds the number of elements with given key.
* @param x Key of (key, value) pairs to be located.
@ -523,7 +523,7 @@ namespace __gnu_norm
size_type
count(const key_type& __x) const
{ return _M_t.find(__x) == _M_t.end() ? 0 : 1; }
/**
* @brief Finds the beginning of a subsequence matching given key.
* @param x Key of (key, value) pair to be located.
@ -538,7 +538,7 @@ namespace __gnu_norm
iterator
lower_bound(const key_type& __x)
{ return _M_t.lower_bound(__x); }
/**
* @brief Finds the beginning of a subsequence matching given key.
* @param x Key of (key, value) pair to be located.
@ -553,7 +553,7 @@ namespace __gnu_norm
const_iterator
lower_bound(const key_type& __x) const
{ return _M_t.lower_bound(__x); }
/**
* @brief Finds the end of a subsequence matching given key.
* @param x Key of (key, value) pair to be located.
@ -563,7 +563,7 @@ namespace __gnu_norm
iterator
upper_bound(const key_type& __x)
{ return _M_t.upper_bound(__x); }
/**
* @brief Finds the end of a subsequence matching given key.
* @param x Key of (key, value) pair to be located.
@ -573,7 +573,7 @@ namespace __gnu_norm
const_iterator
upper_bound(const key_type& __x) const
{ return _M_t.upper_bound(__x); }
/**
* @brief Finds a subsequence matching given key.
* @param x Key of (key, value) pairs to be located.
@ -592,7 +592,7 @@ namespace __gnu_norm
pair<iterator,iterator>
equal_range(const key_type& __x)
{ return _M_t.equal_range(__x); }
/**
* @brief Finds a subsequence matching given key.
* @param x Key of (key, value) pairs to be located.
@ -611,7 +611,7 @@ namespace __gnu_norm
pair<const_iterator,const_iterator>
equal_range(const key_type& __x) const
{ return _M_t.equal_range(__x); }
template <typename _K1, typename _T1, typename _C1, typename _A1>
friend bool
operator== (const map<_K1,_T1,_C1,_A1>&,
@ -622,7 +622,7 @@ namespace __gnu_norm
operator< (const map<_K1,_T1,_C1,_A1>&,
const map<_K1,_T1,_C1,_A1>&);
};
/**
* @brief Map equality comparison.
* @param x A %map.
@ -638,7 +638,7 @@ namespace __gnu_norm
operator==(const map<_Key,_Tp,_Compare,_Alloc>& __x,
const map<_Key,_Tp,_Compare,_Alloc>& __y)
{ return __x._M_t == __y._M_t; }
/**
* @brief Map ordering relation.
* @param x A %map.
@ -655,35 +655,35 @@ namespace __gnu_norm
operator<(const map<_Key,_Tp,_Compare,_Alloc>& __x,
const map<_Key,_Tp,_Compare,_Alloc>& __y)
{ return __x._M_t < __y._M_t; }
/// Based on operator==
template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool
operator!=(const map<_Key,_Tp,_Compare,_Alloc>& __x,
const map<_Key,_Tp,_Compare,_Alloc>& __y)
{ return !(__x == __y); }
/// Based on operator<
template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool
operator>(const map<_Key,_Tp,_Compare,_Alloc>& __x,
const map<_Key,_Tp,_Compare,_Alloc>& __y)
{ return __y < __x; }
/// Based on operator<
template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool
operator<=(const map<_Key,_Tp,_Compare,_Alloc>& __x,
const map<_Key,_Tp,_Compare,_Alloc>& __y)
{ return !(__y < __x); }
/// Based on operator<
template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool
operator>=(const map<_Key,_Tp,_Compare,_Alloc>& __x,
const map<_Key,_Tp,_Compare,_Alloc>& __y)
{ return !(__x < __y); }
/// See std::map::swap().
template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline void

View File

@ -66,22 +66,22 @@
namespace __gnu_norm
{
// Forward declaration of operators < and ==, needed for friend declaration.
template <typename _Key, typename _Tp,
typename _Compare = less<_Key>,
typename _Alloc = allocator<pair<const _Key, _Tp> > >
class multimap;
template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool
operator==(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
const multimap<_Key,_Tp,_Compare,_Alloc>& __y);
template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool
operator<(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
const multimap<_Key,_Tp,_Compare,_Alloc>& __y);
/**
* @brief A standard container made up of (key,value) pairs, which can be
* retrieved based on a key, in logarithmic time.
@ -110,35 +110,35 @@ namespace __gnu_norm
__glibcxx_class_requires(_Tp, _SGIAssignableConcept)
__glibcxx_class_requires4(_Compare, bool, _Key, _Key,
_BinaryFunctionConcept)
public:
typedef _Key key_type;
typedef _Tp mapped_type;
typedef pair<const _Key, _Tp> value_type;
typedef _Compare key_compare;
class value_compare
: public binary_function<value_type, value_type, bool>
{
friend class multimap<_Key,_Tp,_Compare,_Alloc>;
protected:
_Compare comp;
value_compare(_Compare __c)
: comp(__c) { }
public:
bool operator()(const value_type& __x, const value_type& __y) const
{ return comp(__x.first, __y.first); }
};
private:
/// @if maint This turns a red-black tree into a [multi]map. @endif
typedef _Rb_tree<key_type, value_type,
_Select1st<value_type>, key_compare, _Alloc> _Rep_type;
/// @if maint The actual tree structure. @endif
_Rep_type _M_t;
public:
// many of these are specified differently in ISO, but the following are
// "functionally equivalent"
@ -153,8 +153,8 @@ namespace __gnu_norm
typedef typename _Rep_type::const_pointer const_pointer;
typedef typename _Rep_type::reverse_iterator reverse_iterator;
typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
// [23.3.2] construct/copy/destroy
// (get_allocator() is also listed in this section)
/**
@ -162,7 +162,7 @@ namespace __gnu_norm
*/
multimap()
: _M_t(_Compare(), allocator_type()) { }
// for some reason this was made a separate function
/**
* @brief Default constructor creates no elements.
@ -171,7 +171,7 @@ namespace __gnu_norm
multimap(const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { }
/**
* @brief %Multimap copy constructor.
* @param x A %multimap of identical element and allocator types.
@ -181,7 +181,7 @@ namespace __gnu_norm
*/
multimap(const multimap& __x)
: _M_t(__x._M_t) { }
/**
* @brief Builds a %multimap from a range.
* @param first An input iterator.
@ -195,7 +195,7 @@ namespace __gnu_norm
multimap(_InputIterator __first, _InputIterator __last)
: _M_t(_Compare(), allocator_type())
{ _M_t.insert_equal(__first, __last); }
/**
* @brief Builds a %multimap from a range.
* @param first An input iterator.
@ -213,7 +213,7 @@ namespace __gnu_norm
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a)
{ _M_t.insert_equal(__first, __last); }
// FIXME There is no dtor declared, but we should have something generated
// by Doxygen. I don't know what tags to add to this paragraph to make
// that happen:
@ -222,7 +222,7 @@ namespace __gnu_norm
* themselves are pointers, the pointed-to memory is not touched in any
* way. Managing the pointer is the user's responsibilty.
*/
/**
* @brief %Multimap assignment operator.
* @param x A %multimap of identical element and allocator types.
@ -236,12 +236,12 @@ namespace __gnu_norm
_M_t = __x._M_t;
return *this;
}
/// Get a copy of the memory allocation object.
allocator_type
get_allocator() const
{ return _M_t.get_allocator(); }
// iterators
/**
* Returns a read/write iterator that points to the first pair in the
@ -251,7 +251,7 @@ namespace __gnu_norm
iterator
begin()
{ return _M_t.begin(); }
/**
* Returns a read-only (constant) iterator that points to the first pair
* in the %multimap. Iteration is done in ascending order according to
@ -260,7 +260,7 @@ namespace __gnu_norm
const_iterator
begin() const
{ return _M_t.begin(); }
/**
* Returns a read/write iterator that points one past the last pair in
* the %multimap. Iteration is done in ascending order according to the
@ -269,7 +269,7 @@ namespace __gnu_norm
iterator
end()
{ return _M_t.end(); }
/**
* Returns a read-only (constant) iterator that points one past the last
* pair in the %multimap. Iteration is done in ascending order according
@ -278,7 +278,7 @@ namespace __gnu_norm
const_iterator
end() const
{ return _M_t.end(); }
/**
* Returns a read/write reverse iterator that points to the last pair in
* the %multimap. Iteration is done in descending order according to the
@ -287,7 +287,7 @@ namespace __gnu_norm
reverse_iterator
rbegin()
{ return _M_t.rbegin(); }
/**
* Returns a read-only (constant) reverse iterator that points to the
* last pair in the %multimap. Iteration is done in descending order
@ -296,7 +296,7 @@ namespace __gnu_norm
const_reverse_iterator
rbegin() const
{ return _M_t.rbegin(); }
/**
* Returns a read/write reverse iterator that points to one before the
* first pair in the %multimap. Iteration is done in descending order
@ -305,7 +305,7 @@ namespace __gnu_norm
reverse_iterator
rend()
{ return _M_t.rend(); }
/**
* Returns a read-only (constant) reverse iterator that points to one
* before the first pair in the %multimap. Iteration is done in
@ -314,23 +314,23 @@ namespace __gnu_norm
const_reverse_iterator
rend() const
{ return _M_t.rend(); }
// capacity
/** Returns true if the %multimap is empty. */
bool
empty() const
{ return _M_t.empty(); }
/** Returns the size of the %multimap. */
size_type
size() const
{ return _M_t.size(); }
/** Returns the maximum size of the %multimap. */
size_type
max_size() const
{ return _M_t.max_size(); }
// modifiers
/**
* @brief Inserts a std::pair into the %multimap.
@ -338,7 +338,7 @@ namespace __gnu_norm
* of pairs).
* @return An iterator that points to the inserted (key,value) pair.
*
* This function inserts a (key, value) pair into the %multimap.
* This function inserts a (key, value) pair into the %multimap.
* Contrary to a std::map the %multimap does not rely on unique keys and
* thus multiple pairs with the same key can be inserted.
*
@ -347,7 +347,7 @@ namespace __gnu_norm
iterator
insert(const value_type& __x)
{ return _M_t.insert_equal(__x); }
/**
* @brief Inserts a std::pair into the %multimap.
* @param position An iterator that serves as a hint as to where the
@ -356,7 +356,7 @@ namespace __gnu_norm
* of pairs).
* @return An iterator that points to the inserted (key,value) pair.
*
* This function inserts a (key, value) pair into the %multimap.
* This function inserts a (key, value) pair into the %multimap.
* Contrary to a std::map the %multimap does not rely on unique keys and
* thus multiple pairs with the same key can be inserted.
* Note that the first parameter is only a hint and can potentially
@ -371,7 +371,7 @@ namespace __gnu_norm
iterator
insert(iterator __position, const value_type& __x)
{ return _M_t.insert_equal(__position, __x); }
/**
* @brief A template function that attemps to insert a range of elements.
* @param first Iterator pointing to the start of the range to be
@ -384,7 +384,7 @@ namespace __gnu_norm
void
insert(_InputIterator __first, _InputIterator __last)
{ _M_t.insert_equal(__first, __last); }
/**
* @brief Erases an element from a %multimap.
* @param position An iterator pointing to the element to be erased.
@ -398,7 +398,7 @@ namespace __gnu_norm
void
erase(iterator __position)
{ _M_t.erase(__position); }
/**
* @brief Erases elements according to the provided key.
* @param x Key of element to be erased.
@ -413,7 +413,7 @@ namespace __gnu_norm
size_type
erase(const key_type& __x)
{ return _M_t.erase(__x); }
/**
* @brief Erases a [first,last) range of elements from a %multimap.
* @param first Iterator pointing to the start of the range to be
@ -428,7 +428,7 @@ namespace __gnu_norm
void
erase(iterator __first, iterator __last)
{ _M_t.erase(__first, __last); }
/**
* @brief Swaps data with another %multimap.
* @param x A %multimap of the same element and allocator types.
@ -443,7 +443,7 @@ namespace __gnu_norm
void
swap(multimap& __x)
{ _M_t.swap(__x._M_t); }
/**
* Erases all elements in a %multimap. Note that this function only
* erases the elements, and that if the elements themselves are pointers,
@ -453,7 +453,7 @@ namespace __gnu_norm
void
clear()
{ _M_t.clear(); }
// observers
/**
* Returns the key comparison object out of which the %multimap
@ -462,7 +462,7 @@ namespace __gnu_norm
key_compare
key_comp() const
{ return _M_t.key_comp(); }
/**
* Returns a value comparison object, built from the key comparison
* object out of which the %multimap was constructed.
@ -470,7 +470,7 @@ namespace __gnu_norm
value_compare
value_comp() const
{ return value_compare(_M_t.key_comp()); }
// multimap operations
/**
* @brief Tries to locate an element in a %multimap.
@ -486,7 +486,7 @@ namespace __gnu_norm
iterator
find(const key_type& __x)
{ return _M_t.find(__x); }
/**
* @brief Tries to locate an element in a %multimap.
* @param x Key of (key, value) pair to be located.
@ -501,7 +501,7 @@ namespace __gnu_norm
const_iterator
find(const key_type& __x) const
{ return _M_t.find(__x); }
/**
* @brief Finds the number of elements with given key.
* @param x Key of (key, value) pairs to be located.
@ -510,7 +510,7 @@ namespace __gnu_norm
size_type
count(const key_type& __x) const
{ return _M_t.count(__x); }
/**
* @brief Finds the beginning of a subsequence matching given key.
* @param x Key of (key, value) pair to be located.
@ -525,7 +525,7 @@ namespace __gnu_norm
iterator
lower_bound(const key_type& __x)
{ return _M_t.lower_bound(__x); }
/**
* @brief Finds the beginning of a subsequence matching given key.
* @param x Key of (key, value) pair to be located.
@ -540,7 +540,7 @@ namespace __gnu_norm
const_iterator
lower_bound(const key_type& __x) const
{ return _M_t.lower_bound(__x); }
/**
* @brief Finds the end of a subsequence matching given key.
* @param x Key of (key, value) pair to be located.
@ -550,7 +550,7 @@ namespace __gnu_norm
iterator
upper_bound(const key_type& __x)
{ return _M_t.upper_bound(__x); }
/**
* @brief Finds the end of a subsequence matching given key.
* @param x Key of (key, value) pair to be located.
@ -560,7 +560,7 @@ namespace __gnu_norm
const_iterator
upper_bound(const key_type& __x) const
{ return _M_t.upper_bound(__x); }
/**
* @brief Finds a subsequence matching given key.
* @param x Key of (key, value) pairs to be located.
@ -577,7 +577,7 @@ namespace __gnu_norm
pair<iterator,iterator>
equal_range(const key_type& __x)
{ return _M_t.equal_range(__x); }
/**
* @brief Finds a subsequence matching given key.
* @param x Key of (key, value) pairs to be located.
@ -594,18 +594,18 @@ namespace __gnu_norm
pair<const_iterator,const_iterator>
equal_range(const key_type& __x) const
{ return _M_t.equal_range(__x); }
template <typename _K1, typename _T1, typename _C1, typename _A1>
friend bool
operator== (const multimap<_K1,_T1,_C1,_A1>&,
const multimap<_K1,_T1,_C1,_A1>&);
template <typename _K1, typename _T1, typename _C1, typename _A1>
friend bool
operator< (const multimap<_K1,_T1,_C1,_A1>&,
const multimap<_K1,_T1,_C1,_A1>&);
};
/**
* @brief Multimap equality comparison.
* @param x A %multimap.
@ -621,7 +621,7 @@ namespace __gnu_norm
operator==(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
const multimap<_Key,_Tp,_Compare,_Alloc>& __y)
{ return __x._M_t == __y._M_t; }
/**
* @brief Multimap ordering relation.
* @param x A %multimap.
@ -638,35 +638,35 @@ namespace __gnu_norm
operator<(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
const multimap<_Key,_Tp,_Compare,_Alloc>& __y)
{ return __x._M_t < __y._M_t; }
/// Based on operator==
template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool
operator!=(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
const multimap<_Key,_Tp,_Compare,_Alloc>& __y)
{ return !(__x == __y); }
/// Based on operator<
template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool
operator>(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
const multimap<_Key,_Tp,_Compare,_Alloc>& __y)
{ return __y < __x; }
/// Based on operator<
template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool
operator<=(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
const multimap<_Key,_Tp,_Compare,_Alloc>& __y)
{ return !(__y < __x); }
/// Based on operator<
template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline bool
operator>=(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
const multimap<_Key,_Tp,_Compare,_Alloc>& __y)
{ return !(__x < __y); }
/// See std::multimap::swap().
template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
inline void

View File

@ -73,12 +73,12 @@ namespace __gnu_norm
template <class _Key, class _Compare, class _Alloc>
inline bool
operator==(const multiset<_Key,_Compare,_Alloc>& __x,
operator==(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y);
template <class _Key, class _Compare, class _Alloc>
inline bool
operator<(const multiset<_Key,_Compare,_Alloc>& __x,
operator<(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y);
/**
@ -108,17 +108,17 @@ namespace __gnu_norm
__glibcxx_class_requires(_Key, _SGIAssignableConcept)
__glibcxx_class_requires4(_Compare, bool, _Key, _Key,
_BinaryFunctionConcept)
public:
// typedefs:
typedef _Key key_type;
typedef _Key value_type;
typedef _Compare key_compare;
typedef _Compare value_compare;
private:
/// @if maint This turns a red-black tree into a [multi]set. @endif
typedef _Rb_tree<key_type, value_type,
typedef _Rb_tree<key_type, value_type,
_Identity<value_type>, key_compare, _Alloc> _Rep_type;
/// @if maint The actual tree structure. @endif
_Rep_type _M_t;
@ -137,7 +137,7 @@ namespace __gnu_norm
typedef typename _Rep_type::allocator_type allocator_type;
// allocation/deallocation
/**
* @brief Default constructor creates no elements.
*/
@ -201,12 +201,12 @@ namespace __gnu_norm
multiset<_Key,_Compare,_Alloc>&
operator=(const multiset<_Key,_Compare,_Alloc>& __x)
{
_M_t = __x._M_t;
_M_t = __x._M_t;
return *this;
}
// accessors:
/// Returns the comparison object.
key_compare
key_comp() const
@ -219,7 +219,7 @@ namespace __gnu_norm
allocator_type
get_allocator() const
{ return _M_t.get_allocator(); }
/**
* Returns a read/write iterator that points to the first element in the
* %multiset. Iteration is done in ascending order according to the
@ -237,7 +237,7 @@ namespace __gnu_norm
iterator
end() const
{ return _M_t.end(); }
/**
* Returns a read/write reverse iterator that points to the last element
* in the %multiset. Iteration is done in descending order according to
@ -245,8 +245,8 @@ namespace __gnu_norm
*/
reverse_iterator
rbegin() const
{ return _M_t.rbegin(); }
{ return _M_t.rbegin(); }
/**
* Returns a read/write reverse iterator that points to the last element
* in the %multiset. Iteration is done in descending order according to
@ -255,22 +255,22 @@ namespace __gnu_norm
reverse_iterator
rend() const
{ return _M_t.rend(); }
/// Returns true if the %set is empty.
bool
empty() const
{ return _M_t.empty(); }
/// Returns the size of the %set.
size_type
size() const
{ return _M_t.size(); }
/// Returns the maximum size of the %set.
size_type
max_size() const
{ return _M_t.max_size(); }
/**
* @brief Swaps data with another %multiset.
* @param x A %multiset of the same element and allocator types.
@ -285,7 +285,7 @@ namespace __gnu_norm
void
swap(multiset<_Key,_Compare,_Alloc>& __x)
{ _M_t.swap(__x._M_t); }
// insert/erase
/**
* @brief Inserts an element into the %multiset.
@ -301,7 +301,7 @@ namespace __gnu_norm
iterator
insert(const value_type& __x)
{ return _M_t.insert_equal(__x); }
/**
* @brief Inserts an element into the %multiset.
* @param position An iterator that serves as a hint as to where the
@ -354,11 +354,11 @@ namespace __gnu_norm
*/
void
erase(iterator __position)
{
{
typedef typename _Rep_type::iterator _Rep_iterator;
_M_t.erase((_Rep_iterator&)__position);
_M_t.erase((_Rep_iterator&)__position);
}
/**
* @brief Erases elements according to the provided key.
* @param x Key of element to be erased.
@ -373,7 +373,7 @@ namespace __gnu_norm
size_type
erase(const key_type& __x)
{ return _M_t.erase(__x); }
/**
* @brief Erases a [first,last) range of elements from a %multiset.
* @param first Iterator pointing to the start of the range to be
@ -387,11 +387,11 @@ namespace __gnu_norm
*/
void
erase(iterator __first, iterator __last)
{
{
typedef typename _Rep_type::iterator _Rep_iterator;
_M_t.erase((_Rep_iterator&)__first, (_Rep_iterator&)__last);
_M_t.erase((_Rep_iterator&)__first, (_Rep_iterator&)__last);
}
/**
* Erases all elements in a %multiset. Note that this function only
* erases the elements, and that if the elements themselves are pointers,
@ -401,9 +401,9 @@ namespace __gnu_norm
void
clear()
{ _M_t.clear(); }
// multiset operations:
/**
* @brief Finds the number of elements with given key.
* @param x Key of elements to be located.
@ -412,7 +412,7 @@ namespace __gnu_norm
size_type
count(const key_type& __x) const
{ return _M_t.count(__x); }
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 214. set::find() missing const overload
//@{
@ -430,12 +430,12 @@ namespace __gnu_norm
iterator
find(const key_type& __x)
{ return _M_t.find(__x); }
const_iterator
find(const key_type& __x) const
{ return _M_t.find(__x); }
//@}
//@{
/**
* @brief Finds the beginning of a subsequence matching given key.
@ -451,12 +451,12 @@ namespace __gnu_norm
iterator
lower_bound(const key_type& __x)
{ return _M_t.lower_bound(__x); }
const_iterator
lower_bound(const key_type& __x) const
{ return _M_t.lower_bound(__x); }
//@}
//@{
/**
* @brief Finds the end of a subsequence matching given key.
@ -467,12 +467,12 @@ namespace __gnu_norm
iterator
upper_bound(const key_type& __x)
{ return _M_t.upper_bound(__x); }
const_iterator
upper_bound(const key_type& __x) const
{ return _M_t.upper_bound(__x); }
//@}
//@{
/**
* @brief Finds a subsequence matching given key.
@ -492,11 +492,11 @@ namespace __gnu_norm
pair<iterator,iterator>
equal_range(const key_type& __x)
{ return _M_t.equal_range(__x); }
pair<const_iterator,const_iterator>
equal_range(const key_type& __x) const
{ return _M_t.equal_range(__x); }
template <class _K1, class _C1, class _A1>
friend bool
operator== (const multiset<_K1,_C1,_A1>&,
@ -521,10 +521,10 @@ namespace __gnu_norm
*/
template <class _Key, class _Compare, class _Alloc>
inline bool
operator==(const multiset<_Key,_Compare,_Alloc>& __x,
operator==(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y)
{ return __x._M_t == __y._M_t; }
/**
* @brief Multiset ordering relation.
* @param x A %multiset.
@ -538,42 +538,42 @@ namespace __gnu_norm
*/
template <class _Key, class _Compare, class _Alloc>
inline bool
operator<(const multiset<_Key,_Compare,_Alloc>& __x,
operator<(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y)
{ return __x._M_t < __y._M_t; }
/// Returns !(x == y).
template <class _Key, class _Compare, class _Alloc>
inline bool
operator!=(const multiset<_Key,_Compare,_Alloc>& __x,
operator!=(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y)
{ return !(__x == __y); }
/// Returns y < x.
template <class _Key, class _Compare, class _Alloc>
inline bool
operator>(const multiset<_Key,_Compare,_Alloc>& __x,
operator>(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y)
{ return __y < __x; }
/// Returns !(y < x)
template <class _Key, class _Compare, class _Alloc>
inline bool
operator<=(const multiset<_Key,_Compare,_Alloc>& __x,
operator<=(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y)
{ return !(__y < __x); }
/// Returns !(x < y)
template <class _Key, class _Compare, class _Alloc>
inline bool
operator>=(const multiset<_Key,_Compare,_Alloc>& __x,
operator>=(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y)
{ return !(__x < __y); }
/// See std::multiset::swap().
template <class _Key, class _Compare, class _Alloc>
inline void
swap(multiset<_Key,_Compare,_Alloc>& __x,
swap(multiset<_Key,_Compare,_Alloc>& __x,
multiset<_Key,_Compare,_Alloc>& __y)
{ __x.swap(__y); }

View File

@ -166,7 +166,7 @@ namespace std
typename _BinaryOperation1, typename _BinaryOperation2>
_Tp
inner_product(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _Tp __init,
_InputIterator2 __first2, _Tp __init,
_BinaryOperation1 __binary_op1,
_BinaryOperation2 __binary_op2)
{
@ -195,7 +195,7 @@ namespace std
* @return Iterator pointing just beyond the values written to result.
*/
template<typename _InputIterator, typename _OutputIterator>
_OutputIterator
_OutputIterator
partial_sum(_InputIterator __first, _InputIterator __last,
_OutputIterator __result)
{
@ -231,7 +231,7 @@ namespace std
* @return Iterator pointing just beyond the values written to result.
*/
template<typename _InputIterator, typename _OutputIterator, typename _BinaryOperation>
_OutputIterator
_OutputIterator
partial_sum(_InputIterator __first, _InputIterator __last,
_OutputIterator __result, _BinaryOperation __binary_op)
{
@ -299,7 +299,7 @@ namespace std
* @return Iterator pointing just beyond the values written to result.
*/
template<typename _InputIterator, typename _OutputIterator, typename _BinaryOperation>
_OutputIterator
_OutputIterator
adjacent_difference(_InputIterator __first, _InputIterator __last,
_OutputIterator __result, _BinaryOperation __binary_op)
{

View File

@ -145,7 +145,7 @@ namespace std
inline pair<_T1, _T2>
make_pair(_T1 __x, _T2 __y)
{ return pair<_T1, _T2>(__x, __y); }
} // namespace std
#endif /* _PAIR_H */

View File

@ -69,15 +69,15 @@ namespace std
// Forward declarations of operators < and ==, needed for friend declaration.
template<typename _Tp, typename _Sequence = deque<_Tp> >
class queue;
template<typename _Tp, typename _Seq>
inline bool
inline bool
operator==(const queue<_Tp,_Seq>&, const queue<_Tp,_Seq>&);
template<typename _Tp, typename _Seq>
inline bool
inline bool
operator<(const queue<_Tp,_Seq>&, const queue<_Tp,_Seq>&);
/**
* @brief A standard container giving FIFO behavior.
*
@ -111,22 +111,22 @@ namespace std
__glibcxx_class_requires(_Sequence, _FrontInsertionSequenceConcept)
__glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept)
__glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept)
template<typename _Tp1, typename _Seq1>
friend bool
friend bool
operator==(const queue<_Tp1, _Seq1>&, const queue<_Tp1, _Seq1>&);
template<typename _Tp1, typename _Seq1>
friend bool
friend bool
operator<(const queue<_Tp1, _Seq1>&, const queue<_Tp1, _Seq1>&);
public:
typedef typename _Sequence::value_type value_type;
typedef typename _Sequence::reference reference;
typedef typename _Sequence::const_reference const_reference;
typedef typename _Sequence::size_type size_type;
typedef _Sequence container_type;
protected:
/**
* 'c' is the underlying container. Maintainers wondering why
@ -137,70 +137,70 @@ namespace std
* containers allow for derivation. Odd.)
*/
_Sequence c;
public:
/**
* @brief Default constructor creates no elements.
*/
explicit
queue(const _Sequence& __c = _Sequence()) : c(__c) {}
/**
* Returns true if the %queue is empty.
*/
bool
empty() const
{ return c.empty(); }
/** Returns the number of elements in the %queue. */
size_type
size() const
{ return c.size(); }
/**
* Returns a read/write reference to the data at the first
* element of the %queue.
*/
reference
front()
{
front()
{
__glibcxx_requires_nonempty();
return c.front();
return c.front();
}
/**
* Returns a read-only (constant) reference to the data at the first
* element of the %queue.
*/
const_reference
front() const
{
front() const
{
__glibcxx_requires_nonempty();
return c.front();
return c.front();
}
/**
* Returns a read/write reference to the data at the last
* element of the %queue.
*/
reference
back()
back()
{
__glibcxx_requires_nonempty();
return c.back();
return c.back();
}
/**
* Returns a read-only (constant) reference to the data at the last
* element of the %queue.
*/
const_reference
back() const
back() const
{
__glibcxx_requires_nonempty();
return c.back();
return c.back();
}
/**
* @brief Add data to the end of the %queue.
* @param x Data to be added.
@ -213,7 +213,7 @@ namespace std
void
push(const value_type& __x)
{ c.push_back(__x); }
/**
* @brief Removes first element.
*
@ -226,14 +226,14 @@ namespace std
* called.
*/
void
pop()
{
pop()
{
__glibcxx_requires_nonempty();
c.pop_front();
c.pop_front();
}
};
/**
* @brief Queue equality comparison.
* @param x A %queue.
@ -246,11 +246,11 @@ namespace std
* if their sequences compare equal.
*/
template<typename _Tp, typename _Sequence>
inline bool
operator==(const queue<_Tp,_Sequence>& __x,
inline bool
operator==(const queue<_Tp,_Sequence>& __x,
const queue<_Tp,_Sequence>& __y)
{ return __x.c == __y.c; }
/**
* @brief Queue ordering relation.
* @param x A %queue.
@ -268,34 +268,34 @@ namespace std
inline bool
operator<(const queue<_Tp,_Sequence>& __x, const queue<_Tp,_Sequence>& __y)
{ return __x.c < __y.c; }
/// Based on operator==
template<typename _Tp, typename _Sequence>
inline bool
operator!=(const queue<_Tp,_Sequence>& __x,
operator!=(const queue<_Tp,_Sequence>& __x,
const queue<_Tp,_Sequence>& __y)
{ return !(__x == __y); }
/// Based on operator<
template<typename _Tp, typename _Sequence>
inline bool
inline bool
operator>(const queue<_Tp,_Sequence>& __x, const queue<_Tp,_Sequence>& __y)
{ return __y < __x; }
/// Based on operator<
template<typename _Tp, typename _Sequence>
inline bool
operator<=(const queue<_Tp,_Sequence>& __x,
inline bool
operator<=(const queue<_Tp,_Sequence>& __x,
const queue<_Tp,_Sequence>& __y)
{ return !(__y < __x); }
/// Based on operator<
template<typename _Tp, typename _Sequence>
inline bool
operator>=(const queue<_Tp,_Sequence>& __x,
inline bool
operator>=(const queue<_Tp,_Sequence>& __x,
const queue<_Tp,_Sequence>& __y)
{ return !(__x < __y); }
/**
* @brief A standard container automatically sorting its contents.
*
@ -345,36 +345,36 @@ namespace std
__glibcxx_class_requires(_Sequence, _RandomAccessContainerConcept)
__glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept)
__glibcxx_class_requires4(_Compare, bool, _Tp,_Tp,_BinaryFunctionConcept)
public:
typedef typename _Sequence::value_type value_type;
typedef typename _Sequence::reference reference;
typedef typename _Sequence::const_reference const_reference;
typedef typename _Sequence::size_type size_type;
typedef _Sequence container_type;
protected:
// See queue::c for notes on these names.
_Sequence c;
_Compare comp;
public:
/**
* @brief Default constructor creates no elements.
*/
explicit
priority_queue(const _Compare& __x = _Compare(),
const _Sequence& __s = _Sequence())
: c(__s), comp(__x)
priority_queue(const _Compare& __x = _Compare(),
const _Sequence& __s = _Sequence())
: c(__s), comp(__x)
{ std::make_heap(c.begin(), c.end(), comp); }
/**
* @brief Builds a %queue from a range.
* @param first An input iterator.
* @param last An input iterator.
* @param x A comparison functor describing a strict weak ordering.
* @param s An initial sequence with which to start.
*
*
* Begins by copying @a s, inserting a copy of the elements
* from @a [first,last) into the copy of @a s, then ordering
* the copy according to @a x.
@ -388,33 +388,33 @@ namespace std
const _Compare& __x = _Compare(),
const _Sequence& __s = _Sequence())
: c(__s), comp(__x)
{
{
__glibcxx_requires_valid_range(__first, __last);
c.insert(c.end(), __first, __last);
std::make_heap(c.begin(), c.end(), comp);
}
/**
* Returns true if the %queue is empty.
*/
bool
empty() const { return c.empty(); }
/** Returns the number of elements in the %queue. */
size_type
size() const { return c.size(); }
/**
* Returns a read-only (constant) reference to the data at the first
* element of the %queue.
*/
const_reference
top() const
top() const
{
__glibcxx_requires_nonempty();
return c.front();
return c.front();
}
/**
* @brief Add data to the %queue.
* @param x Data to be added.
@ -423,21 +423,21 @@ namespace std
* The time complexity of the operation depends on the underlying
* sequence.
*/
void
push(const value_type& __x)
void
push(const value_type& __x)
{
try
try
{
c.push_back(__x);
c.push_back(__x);
std::push_heap(c.begin(), c.end(), comp);
}
catch(...)
{
c.clear();
__throw_exception_again;
__throw_exception_again;
}
}
/**
* @brief Removes first element.
*
@ -449,11 +449,11 @@ namespace std
* data is needed, it should be retrieved before pop() is
* called.
*/
void
pop()
void
pop()
{
__glibcxx_requires_nonempty();
try
try
{
std::pop_heap(c.begin(), c.end(), comp);
c.pop_back();
@ -461,11 +461,11 @@ namespace std
catch(...)
{
c.clear();
__throw_exception_again;
__throw_exception_again;
}
}
};
// No equality/comparison operators are provided for priority_queue.
} // namespace std

View File

@ -68,36 +68,36 @@ namespace std
* uninitialized memory.
*/
template <class _ForwardIterator, class _Tp>
class raw_storage_iterator
class raw_storage_iterator
: public iterator<output_iterator_tag, void, void, void, void>
{
protected:
_ForwardIterator _M_iter;
public:
explicit
explicit
raw_storage_iterator(_ForwardIterator __x)
: _M_iter(__x) {}
raw_storage_iterator&
raw_storage_iterator&
operator*() { return *this; }
raw_storage_iterator&
operator=(const _Tp& __element)
raw_storage_iterator&
operator=(const _Tp& __element)
{
std::_Construct(&*_M_iter, __element);
return *this;
}
}
raw_storage_iterator<_ForwardIterator, _Tp>&
operator++()
raw_storage_iterator<_ForwardIterator, _Tp>&
operator++()
{
++_M_iter;
return *this;
}
raw_storage_iterator<_ForwardIterator, _Tp>
operator++(int)
raw_storage_iterator<_ForwardIterator, _Tp>
operator++(int)
{
raw_storage_iterator<_ForwardIterator, _Tp> __tmp = *this;
++_M_iter;

View File

@ -78,7 +78,7 @@ namespace std
/** @namespace std::rel_ops
* @brief The generated relational operators are sequestered here.
*/
/**
* @brief Defines @c != for arbitrary types, in terms of @c ==.
* @param x A thing.

View File

@ -66,18 +66,18 @@
namespace __gnu_norm
{
// Forward declarations of operators < and ==, needed for friend declaration.
template<class _Key, class _Compare = less<_Key>,
template<class _Key, class _Compare = less<_Key>,
class _Alloc = allocator<_Key> >
class set;
template<class _Key, class _Compare, class _Alloc>
inline bool
operator==(const set<_Key,_Compare,_Alloc>& __x,
inline bool
operator==(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y);
template<class _Key, class _Compare, class _Alloc>
inline bool
operator<(const set<_Key,_Compare,_Alloc>& __x,
inline bool
operator<(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y);
/**
@ -110,7 +110,7 @@ namespace __gnu_norm
__glibcxx_class_requires(_Key, _SGIAssignableConcept)
__glibcxx_class_requires4(_Compare, bool, _Key, _Key,
_BinaryFunctionConcept)
public:
// typedefs:
//@{
@ -122,7 +122,7 @@ namespace __gnu_norm
//@}
private:
typedef _Rb_tree<key_type, value_type,
typedef _Rb_tree<key_type, value_type,
_Identity<value_type>, key_compare, _Alloc> _Rep_type;
_Rep_type _M_t; // red-black tree representing set
public:
@ -197,7 +197,7 @@ namespace __gnu_norm
*/
set(const set<_Key,_Compare,_Alloc>& __x)
: _M_t(__x._M_t) { }
/**
* @brief Set assignment operator.
* @param x A %set of identical element and allocator types.
@ -207,8 +207,8 @@ namespace __gnu_norm
*/
set<_Key,_Compare,_Alloc>&
operator=(const set<_Key, _Compare, _Alloc>& __x)
{
_M_t = __x._M_t;
{
_M_t = __x._M_t;
return *this;
}
@ -250,7 +250,7 @@ namespace __gnu_norm
*/
reverse_iterator
rbegin() const
{ return _M_t.rbegin(); }
{ return _M_t.rbegin(); }
/**
* Returns a read-only (constant) reverse iterator that points to the
@ -307,7 +307,7 @@ namespace __gnu_norm
*/
pair<iterator,bool>
insert(const value_type& __x)
{
{
pair<typename _Rep_type::iterator, bool> __p = _M_t.insert_unique(__x);
return pair<iterator, bool>(__p.first, __p.second);
}
@ -350,7 +350,7 @@ namespace __gnu_norm
void
insert(_InputIterator __first, _InputIterator __last)
{ _M_t.insert_unique(__first, __last); }
/**
* @brief Erases an element from a %set.
* @param position An iterator pointing to the element to be erased.
@ -362,9 +362,9 @@ namespace __gnu_norm
*/
void
erase(iterator __position)
{
{
typedef typename _Rep_type::iterator _Rep_iterator;
_M_t.erase((_Rep_iterator&)__position);
_M_t.erase((_Rep_iterator&)__position);
}
/**
@ -396,7 +396,7 @@ namespace __gnu_norm
erase(iterator __first, iterator __last)
{
typedef typename _Rep_type::iterator _Rep_iterator;
_M_t.erase((_Rep_iterator&)__first, (_Rep_iterator&)__last);
_M_t.erase((_Rep_iterator&)__first, (_Rep_iterator&)__last);
}
/**
@ -461,7 +461,7 @@ namespace __gnu_norm
iterator
lower_bound(const key_type& __x)
{ return _M_t.lower_bound(__x); }
const_iterator
lower_bound(const key_type& __x) const
{ return _M_t.lower_bound(__x); }
@ -502,7 +502,7 @@ namespace __gnu_norm
pair<iterator,iterator>
equal_range(const key_type& __x)
{ return _M_t.equal_range(__x); }
pair<const_iterator,const_iterator>
equal_range(const key_type& __x) const
{ return _M_t.equal_range(__x); }
@ -511,7 +511,7 @@ namespace __gnu_norm
template<class _K1, class _C1, class _A1>
friend bool
operator== (const set<_K1,_C1,_A1>&, const set<_K1,_C1,_A1>&);
template<class _K1, class _C1, class _A1>
friend bool
operator< (const set<_K1,_C1,_A1>&, const set<_K1,_C1,_A1>&);
@ -530,7 +530,7 @@ namespace __gnu_norm
*/
template<class _Key, class _Compare, class _Alloc>
inline bool
operator==(const set<_Key,_Compare,_Alloc>& __x,
operator==(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y)
{ return __x._M_t == __y._M_t; }
@ -547,35 +547,35 @@ namespace __gnu_norm
*/
template<class _Key, class _Compare, class _Alloc>
inline bool
operator<(const set<_Key,_Compare,_Alloc>& __x,
operator<(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y)
{ return __x._M_t < __y._M_t; }
/// Returns !(x == y).
template<class _Key, class _Compare, class _Alloc>
inline bool
operator!=(const set<_Key,_Compare,_Alloc>& __x,
operator!=(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y)
{ return !(__x == __y); }
/// Returns y < x.
template<class _Key, class _Compare, class _Alloc>
inline bool
operator>(const set<_Key,_Compare,_Alloc>& __x,
operator>(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y)
{ return __y < __x; }
/// Returns !(y < x)
template<class _Key, class _Compare, class _Alloc>
inline bool
operator<=(const set<_Key,_Compare,_Alloc>& __x,
operator<=(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y)
{ return !(__y < __x); }
/// Returns !(x < y)
template<class _Key, class _Compare, class _Alloc>
inline bool
operator>=(const set<_Key,_Compare,_Alloc>& __x,
operator>=(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y)
{ return !(__x < __y); }

View File

@ -70,15 +70,15 @@ namespace std
// declaration.
template<typename _Tp, typename _Sequence = deque<_Tp> >
class stack;
template<typename _Tp, typename _Seq>
inline bool
inline bool
operator==(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y);
template<typename _Tp, typename _Seq>
inline bool
inline bool
operator<(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y);
/**
* @brief A standard container giving FILO behavior.
*
@ -114,26 +114,26 @@ namespace std
__glibcxx_class_requires(_Tp, _SGIAssignableConcept)
__glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept)
__glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept)
template<typename _Tp1, typename _Seq1>
friend bool
friend bool
operator==(const stack<_Tp1, _Seq1>&, const stack<_Tp1, _Seq1>&);
template<typename _Tp1, typename _Seq1>
friend bool
friend bool
operator<(const stack<_Tp1, _Seq1>&, const stack<_Tp1, _Seq1>&);
public:
typedef typename _Sequence::value_type value_type;
typedef typename _Sequence::reference reference;
typedef typename _Sequence::const_reference const_reference;
typedef typename _Sequence::size_type size_type;
typedef _Sequence container_type;
protected:
// See queue::c for notes on this name.
_Sequence c;
public:
// XXX removed old def ctor, added def arg to this one to match 14882
/**
@ -142,41 +142,41 @@ namespace std
explicit
stack(const _Sequence& __c = _Sequence())
: c(__c) {}
/**
* Returns true if the %stack is empty.
*/
bool
empty() const
{ return c.empty(); }
/** Returns the number of elements in the %stack. */
size_type
size() const
{ return c.size(); }
/**
* Returns a read/write reference to the data at the first
* element of the %stack.
*/
reference
top()
{
top()
{
__glibcxx_requires_nonempty();
return c.back();
return c.back();
}
/**
* Returns a read-only (constant) reference to the data at the first
* element of the %stack.
*/
const_reference
top() const
top() const
{
__glibcxx_requires_nonempty();
return c.back();
return c.back();
}
/**
* @brief Add data to the top of the %stack.
* @param x Data to be added.
@ -189,7 +189,7 @@ namespace std
void
push(const value_type& __x)
{ c.push_back(__x); }
/**
* @brief Removes first element.
*
@ -202,13 +202,13 @@ namespace std
* called.
*/
void
pop()
pop()
{
__glibcxx_requires_nonempty();
c.pop_back();
c.pop_back();
}
};
/**
* @brief Stack equality comparison.
* @param x A %stack.
@ -225,7 +225,7 @@ namespace std
inline bool
operator==(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
{ return __x.c == __y.c; }
/**
* @brief Stack ordering relation.
* @param x A %stack.
@ -243,25 +243,25 @@ namespace std
inline bool
operator<(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
{ return __x.c < __y.c; }
/// Based on operator==
template<typename _Tp, typename _Seq>
inline bool
operator!=(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
{ return !(__x == __y); }
/// Based on operator<
template<typename _Tp, typename _Seq>
inline bool
operator>(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
{ return __y < __x; }
/// Based on operator<
template<typename _Tp, typename _Seq>
inline bool
operator<=(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
{ return !(__y < __x); }
/// Based on operator<
template<typename _Tp, typename _Seq>
inline bool

View File

@ -83,52 +83,52 @@ namespace std
typedef value_type* pointer;
typedef pointer iterator;
typedef ptrdiff_t size_type;
protected:
size_type _M_original_len;
size_type _M_len;
pointer _M_buffer;
void
_M_initialize_buffer(const _Tp&, __true_type) { }
void
_M_initialize_buffer(const _Tp& val, __false_type)
{ std::uninitialized_fill_n(_M_buffer, _M_len, val); }
public:
/// As per Table mumble.
size_type
size() const
{ return _M_len; }
/// Returns the size requested by the constructor; may be >size().
size_type
requested_size() const
{ return _M_original_len; }
/// As per Table mumble.
iterator
begin()
{ return _M_buffer; }
/// As per Table mumble.
iterator
end()
{ return _M_buffer + _M_len; }
/**
* Constructs a temporary buffer of a size somewhere between
* zero and the size of the given range.
*/
_Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last);
~_Temporary_buffer()
{
{
std::_Destroy(_M_buffer, _M_buffer + _M_len);
std::return_temporary_buffer(_M_buffer);
}
private:
// Disable copy constructor and assignment operator.
_Temporary_buffer(const _Temporary_buffer&);
@ -136,12 +136,12 @@ namespace std
void
operator=(const _Temporary_buffer&);
};
template<typename _ForwardIterator, typename _Tp>
_Temporary_buffer<_ForwardIterator, _Tp>::
_Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last)
: _M_original_len(std::distance(__first, __last)),
: _M_original_len(std::distance(__first, __last)),
_M_len(0), _M_buffer(0)
{
// Workaround for a __type_traits bug in the pre-7.3 compiler.
@ -158,11 +158,11 @@ namespace std
_M_initialize_buffer(*__first, _Trivial());
}
catch(...)
{
{
std::return_temporary_buffer(_M_buffer);
_M_buffer = 0;
_M_buffer = 0;
_M_len = 0;
__throw_exception_again;
__throw_exception_again;
}
}
} // namespace std

View File

@ -85,8 +85,8 @@ namespace __gnu_cxx
#endif
__gthread_mutex_t _M_lock;
void
_M_initialize()
void
_M_initialize()
{
#ifdef __GTHREAD_MUTEX_INIT
// There should be no code in this path given the usage rules above.
@ -97,7 +97,7 @@ namespace __gnu_cxx
&& __gthread_active_p())
abort ();
__gthread_mutex_lock(&__gnu_cxx::_GLIBCXX_mutex);
if (!_M_init_flag)
if (!_M_init_flag)
{
// Even though we have a global lock, we use __gthread_once to be
// absolutely certain the _M_lock mutex is only initialized once on
@ -113,8 +113,8 @@ namespace __gnu_cxx
#endif
}
void
_M_acquire_lock()
void
_M_acquire_lock()
{
#if !defined(__GTHREAD_MUTEX_INIT) && defined(__GTHREAD_MUTEX_INIT_FUNCTION)
if (!_M_init_flag) _M_initialize();
@ -122,8 +122,8 @@ namespace __gnu_cxx
__gthread_mutex_lock(&_M_lock);
}
void
_M_release_lock()
void
_M_release_lock()
{
#if !defined(__GTHREAD_MUTEX_INIT) && defined(__GTHREAD_MUTEX_INIT_FUNCTION)
if (!_M_init_flag) _M_initialize();
@ -131,7 +131,7 @@ namespace __gnu_cxx
__gthread_mutex_unlock(&_M_lock);
}
};
#ifdef __GTHREAD_MUTEX_INIT
#define __STL_MUTEX_INITIALIZER = { __GTHREAD_MUTEX_INIT }
#elif defined(__GTHREAD_MUTEX_INIT_FUNCTION)
@ -144,4 +144,4 @@ namespace __gnu_cxx
#endif
} // namespace __gnu_cxx
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -67,20 +67,20 @@ namespace std
{
// uninitialized_copy
template<typename _InputIterator, typename _ForwardIterator>
inline _ForwardIterator
inline _ForwardIterator
__uninitialized_copy_aux(_InputIterator __first, _InputIterator __last,
_ForwardIterator __result,
__true_type)
{ return std::copy(__first, __last, __result); }
template<typename _InputIterator, typename _ForwardIterator>
inline _ForwardIterator
inline _ForwardIterator
__uninitialized_copy_aux(_InputIterator __first, _InputIterator __last,
_ForwardIterator __result,
__false_type)
{
_ForwardIterator __cur = __result;
try
try
{
for ( ; __first != __last; ++__first, ++__cur)
std::_Construct(&*__cur, *__first);
@ -89,7 +89,7 @@ namespace std
catch(...)
{
std::_Destroy(__result, __cur);
__throw_exception_again;
__throw_exception_again;
}
}
@ -104,7 +104,7 @@ namespace std
*/
template<typename _InputIterator, typename _ForwardIterator>
inline _ForwardIterator
uninitialized_copy(_InputIterator __first, _InputIterator __last,
uninitialized_copy(_InputIterator __first, _InputIterator __last,
_ForwardIterator __result)
{
typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
@ -120,7 +120,7 @@ namespace std
return __result + (__last - __first);
}
inline wchar_t*
inline wchar_t*
uninitialized_copy(const wchar_t* __first, const wchar_t* __last,
wchar_t* __result)
{
@ -132,14 +132,14 @@ namespace std
// destructor is trivial.
template<typename _ForwardIterator, typename _Tp>
inline void
__uninitialized_fill_aux(_ForwardIterator __first,
_ForwardIterator __last,
__uninitialized_fill_aux(_ForwardIterator __first,
_ForwardIterator __last,
const _Tp& __x, __true_type)
{ std::fill(__first, __last, __x); }
template<typename _ForwardIterator, typename _Tp>
void
__uninitialized_fill_aux(_ForwardIterator __first, _ForwardIterator __last,
__uninitialized_fill_aux(_ForwardIterator __first, _ForwardIterator __last,
const _Tp& __x, __false_type)
{
_ForwardIterator __cur = __first;
@ -151,7 +151,7 @@ namespace std
catch(...)
{
std::_Destroy(__first, __cur);
__throw_exception_again;
__throw_exception_again;
}
}
@ -166,7 +166,7 @@ namespace std
*/
template<typename _ForwardIterator, typename _Tp>
inline void
uninitialized_fill(_ForwardIterator __first, _ForwardIterator __last,
uninitialized_fill(_ForwardIterator __first, _ForwardIterator __last,
const _Tp& __x)
{
typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
@ -188,16 +188,16 @@ namespace std
const _Tp& __x, __false_type)
{
_ForwardIterator __cur = __first;
try
try
{
for ( ; __n > 0; --__n, ++__cur)
std::_Construct(&*__cur, __x);
return __cur;
}
catch(...)
{
{
std::_Destroy(__first, __cur);
__throw_exception_again;
__throw_exception_again;
}
}
@ -211,7 +211,7 @@ namespace std
* Like fill_n(), but does not require an initialized output range.
*/
template<typename _ForwardIterator, typename _Size, typename _Tp>
inline _ForwardIterator
inline _ForwardIterator
uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x)
{
typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
@ -219,7 +219,7 @@ namespace std
return std::__uninitialized_fill_n_aux(__first, __n, __x, _Is_POD());
}
// Extensions: __uninitialized_copy_copy, __uninitialized_copy_fill,
// Extensions: __uninitialized_copy_copy, __uninitialized_copy_fill,
// __uninitialized_fill_copy.
// __uninitialized_copy_copy
@ -227,12 +227,12 @@ namespace std
// copies [first2, last2) into
// [result, result + (last1 - first1) + (last2 - first2)).
template<typename _InputIterator1, typename _InputIterator2,
template<typename _InputIterator1, typename _InputIterator2,
typename _ForwardIterator>
inline _ForwardIterator
__uninitialized_copy_copy(_InputIterator1 __first1,
__uninitialized_copy_copy(_InputIterator1 __first1,
_InputIterator1 __last1,
_InputIterator2 __first2,
_InputIterator2 __first2,
_InputIterator2 __last2,
_ForwardIterator __result)
{
@ -243,9 +243,9 @@ namespace std
return std::uninitialized_copy(__first2, __last2, __mid);
}
catch(...)
{
{
std::_Destroy(__result, __mid);
__throw_exception_again;
__throw_exception_again;
}
}
@ -253,7 +253,7 @@ namespace std
// Fills [result, mid) with x, and copies [first, last) into
// [mid, mid + (last - first)).
template<typename _ForwardIterator, typename _Tp, typename _InputIterator>
inline _ForwardIterator
inline _ForwardIterator
__uninitialized_fill_copy(_ForwardIterator __result, _ForwardIterator __mid,
const _Tp& __x, _InputIterator __first,
_InputIterator __last)
@ -266,7 +266,7 @@ namespace std
catch(...)
{
std::_Destroy(__result, __mid);
__throw_exception_again;
__throw_exception_again;
}
}
@ -279,16 +279,16 @@ namespace std
_ForwardIterator __first2,
_ForwardIterator __last2, const _Tp& __x)
{
_ForwardIterator __mid2 = std::uninitialized_copy(__first1, __last1,
_ForwardIterator __mid2 = std::uninitialized_copy(__first1, __last1,
__first2);
try
try
{
std::uninitialized_fill(__mid2, __last2, __x);
}
catch(...)
{
std::_Destroy(__first2, __mid2);
__throw_exception_again;
__throw_exception_again;
}
}

View File

@ -84,7 +84,7 @@ namespace __gnu_norm
_Vector_base(const allocator_type& __a)
: _Alloc(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0) { }
_Vector_base(size_t __n, const allocator_type& __a)
: _Alloc(__a)
{
@ -92,25 +92,25 @@ namespace __gnu_norm
this->_M_finish = this->_M_start;
this->_M_end_of_storage = this->_M_start + __n;
}
~_Vector_base()
{ _M_deallocate(this->_M_start,
~_Vector_base()
{ _M_deallocate(this->_M_start,
this->_M_end_of_storage - this->_M_start); }
public:
_Tp* _M_start;
_Tp* _M_finish;
_Tp* _M_end_of_storage;
_Tp*
_M_allocate(size_t __n) { return _Alloc::allocate(__n); }
void
_M_deallocate(_Tp* __p, size_t __n)
{ if (__p) _Alloc::deallocate(__p, __n); }
};
/**
* @brief A standard container which offers fixed time access to
* individual elements in any order.
@ -135,25 +135,25 @@ namespace __gnu_norm
{
// Concept requirements.
__glibcxx_class_requires(_Tp, _SGIAssignableConcept)
typedef _Vector_base<_Tp, _Alloc> _Base;
typedef vector<_Tp, _Alloc> vector_type;
typedef _Vector_base<_Tp, _Alloc> _Base;
typedef vector<_Tp, _Alloc> vector_type;
public:
typedef _Tp value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef _Tp value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef __gnu_cxx::__normal_iterator<pointer, vector_type> iterator;
typedef __gnu_cxx::__normal_iterator<const_pointer, vector_type>
const_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef typename _Base::allocator_type allocator_type;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef typename _Base::allocator_type allocator_type;
protected:
/** @if maint
* These two functions and three data members are all from the
@ -165,7 +165,7 @@ namespace __gnu_norm
using _Base::_M_start;
using _Base::_M_finish;
using _Base::_M_end_of_storage;
public:
// [23.2.4.1] construct/copy/destroy
// (assign() and get_allocator() are also listed in this section)
@ -175,24 +175,24 @@ namespace __gnu_norm
explicit
vector(const allocator_type& __a = allocator_type())
: _Base(__a) { }
/**
* @brief Create a %vector with copies of an exemplar element.
* @param n The number of elements to initially create.
* @param value An element to copy.
*
*
* This constructor fills the %vector with @a n copies of @a value.
*/
vector(size_type __n, const value_type& __value,
const allocator_type& __a = allocator_type())
: _Base(__n, __a)
{ this->_M_finish = std::uninitialized_fill_n(this->_M_start,
{ this->_M_finish = std::uninitialized_fill_n(this->_M_start,
__n, __value); }
/**
* @brief Create a %vector with default elements.
* @param n The number of elements to initially create.
*
*
* This constructor fills the %vector with @a n copies of a
* default-constructed element.
*/
@ -201,11 +201,11 @@ namespace __gnu_norm
: _Base(__n, allocator_type())
{ this->_M_finish = std::uninitialized_fill_n(this->_M_start,
__n, value_type()); }
/**
* @brief %Vector copy constructor.
* @param x A %vector of identical element and allocator types.
*
*
* The newly-created %vector uses a copy of the allocation
* object used by @a x. All the elements of @a x are copied,
* but any extra memory in
@ -216,12 +216,12 @@ namespace __gnu_norm
{ this->_M_finish = std::uninitialized_copy(__x.begin(), __x.end(),
this->_M_start);
}
/**
* @brief Builds a %vector from a range.
* @param first An input iterator.
* @param last An input iterator.
*
*
* Create a %vector consisting of copies of the elements from
* [first,last).
*
@ -241,7 +241,7 @@ namespace __gnu_norm
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_initialize_dispatch(__first, __last, _Integral());
}
/**
* The dtor only erases the elements, and note that if the
* elements themselves are pointers, the pointed-to memory is
@ -249,18 +249,18 @@ namespace __gnu_norm
* responsibilty.
*/
~vector() { std::_Destroy(this->_M_start, this->_M_finish); }
/**
* @brief %Vector assignment operator.
* @param x A %vector of identical element and allocator types.
*
*
* All the elements of @a x are copied, but any extra memory in
* @a x (for fast expansion) will not be copied. Unlike the
* copy constructor, the allocator object is not copied.
*/
vector&
operator=(const vector& __x);
/**
* @brief Assigns a given value to a %vector.
* @param n Number of elements to be assigned.
@ -272,9 +272,9 @@ namespace __gnu_norm
* the number of elements assigned. Old data may be lost.
*/
void
assign(size_type __n, const value_type& __val)
assign(size_type __n, const value_type& __val)
{ _M_fill_assign(__n, __val); }
/**
* @brief Assigns a range to a %vector.
* @param first An input iterator.
@ -295,10 +295,10 @@ namespace __gnu_norm
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_assign_dispatch(__first, __last, _Integral());
}
/// Get a copy of the memory allocation object.
using _Base::get_allocator;
// iterators
/**
* Returns a read/write iterator that points to the first
@ -307,7 +307,7 @@ namespace __gnu_norm
*/
iterator
begin() { return iterator (this->_M_start); }
/**
* Returns a read-only (constant) iterator that points to the
* first element in the %vector. Iteration is done in ordinary
@ -315,7 +315,7 @@ namespace __gnu_norm
*/
const_iterator
begin() const { return const_iterator (this->_M_start); }
/**
* Returns a read/write iterator that points one past the last
* element in the %vector. Iteration is done in ordinary
@ -323,7 +323,7 @@ namespace __gnu_norm
*/
iterator
end() { return iterator (this->_M_finish); }
/**
* Returns a read-only (constant) iterator that points one past
* the last element in the %vector. Iteration is done in
@ -331,7 +331,7 @@ namespace __gnu_norm
*/
const_iterator
end() const { return const_iterator (this->_M_finish); }
/**
* Returns a read/write reverse iterator that points to the
* last element in the %vector. Iteration is done in reverse
@ -339,7 +339,7 @@ namespace __gnu_norm
*/
reverse_iterator
rbegin() { return reverse_iterator(end()); }
/**
* Returns a read-only (constant) reverse iterator that points
* to the last element in the %vector. Iteration is done in
@ -347,7 +347,7 @@ namespace __gnu_norm
*/
const_reverse_iterator
rbegin() const { return const_reverse_iterator(end()); }
/**
* Returns a read/write reverse iterator that points to one
* before the first element in the %vector. Iteration is done
@ -355,7 +355,7 @@ namespace __gnu_norm
*/
reverse_iterator
rend() { return reverse_iterator(begin()); }
/**
* Returns a read-only (constant) reverse iterator that points
* to one before the first element in the %vector. Iteration
@ -363,16 +363,16 @@ namespace __gnu_norm
*/
const_reverse_iterator
rend() const { return const_reverse_iterator(begin()); }
// [23.2.4.2] capacity
/** Returns the number of elements in the %vector. */
size_type
size() const { return size_type(end() - begin()); }
/** Returns the size() of the largest possible %vector. */
size_type
max_size() const { return size_type(-1) / sizeof(value_type); }
/**
* @brief Resizes the %vector to the specified number of elements.
* @param new_size Number of elements the %vector should contain.
@ -392,7 +392,7 @@ namespace __gnu_norm
else
insert(end(), __new_size - size(), __x);
}
/**
* @brief Resizes the %vector to the specified number of elements.
* @param new_size Number of elements the %vector should contain.
@ -405,7 +405,7 @@ namespace __gnu_norm
*/
void
resize(size_type __new_size) { resize(__new_size, value_type()); }
/**
* Returns the total number of elements that the %vector can
* hold before needing to allocate more memory.
@ -413,14 +413,14 @@ namespace __gnu_norm
size_type
capacity() const
{ return size_type(const_iterator(this->_M_end_of_storage) - begin()); }
/**
* Returns true if the %vector is empty. (Thus begin() would
* equal end().)
*/
bool
empty() const { return begin() == end(); }
/**
* @brief Attempt to preallocate enough memory for specified number of
* elements.
@ -440,7 +440,7 @@ namespace __gnu_norm
*/
void
reserve(size_type __n);
// element access
/**
* @brief Subscript access to the data contained in the %vector.
@ -455,7 +455,7 @@ namespace __gnu_norm
*/
reference
operator[](size_type __n) { return *(begin() + __n); }
/**
* @brief Subscript access to the data contained in the %vector.
* @param n The index of the element for which data should be
@ -469,7 +469,7 @@ namespace __gnu_norm
*/
const_reference
operator[](size_type __n) const { return *(begin() + __n); }
protected:
/// @if maint Safety check used only from at(). @endif
void
@ -478,7 +478,7 @@ namespace __gnu_norm
if (__n >= this->size())
__throw_out_of_range(__N("vector::_M_range_check"));
}
public:
/**
* @brief Provides access to the data contained in the %vector.
@ -493,7 +493,7 @@ namespace __gnu_norm
*/
reference
at(size_type __n) { _M_range_check(__n); return (*this)[__n]; }
/**
* @brief Provides access to the data contained in the %vector.
* @param n The index of the element for which data should be
@ -507,35 +507,35 @@ namespace __gnu_norm
*/
const_reference
at(size_type __n) const { _M_range_check(__n); return (*this)[__n]; }
/**
* Returns a read/write reference to the data at the first
* element of the %vector.
*/
reference
front() { return *begin(); }
/**
* Returns a read-only (constant) reference to the data at the first
* element of the %vector.
*/
const_reference
front() const { return *begin(); }
/**
* Returns a read/write reference to the data at the last
* element of the %vector.
*/
reference
back() { return *(end() - 1); }
/**
* Returns a read-only (constant) reference to the data at the
* last element of the %vector.
*/
const_reference
back() const { return *(end() - 1); }
// [23.2.4.3] modifiers
/**
* @brief Add data to the end of the %vector.
@ -558,7 +558,7 @@ namespace __gnu_norm
else
_M_insert_aux(end(), __x);
}
/**
* @brief Removes last element.
*
@ -574,7 +574,7 @@ namespace __gnu_norm
--this->_M_finish;
std::_Destroy(this->_M_finish);
}
/**
* @brief Inserts given value into %vector before specified iterator.
* @param position An iterator into the %vector.
@ -605,7 +605,7 @@ namespace __gnu_norm
void
insert(iterator __position, size_type __n, const value_type& __x)
{ _M_fill_insert(__position, __n, __x); }
/**
* @brief Inserts a range into the %vector.
* @param position An iterator into the %vector.
@ -622,14 +622,14 @@ namespace __gnu_norm
*/
template<typename _InputIterator>
void
insert(iterator __position, _InputIterator __first,
insert(iterator __position, _InputIterator __first,
_InputIterator __last)
{
// Check whether it's an integral type. If so, it's not an iterator.
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_insert_dispatch(__position, __first, __last, _Integral());
}
/**
* @brief Remove element at given position.
* @param position Iterator pointing to element to be erased.
@ -647,7 +647,7 @@ namespace __gnu_norm
*/
iterator
erase(iterator __position);
/**
* @brief Remove a range of elements.
* @param first Iterator pointing to the first element to be erased.
@ -668,7 +668,7 @@ namespace __gnu_norm
*/
iterator
erase(iterator __first, iterator __last);
/**
* @brief Swaps data with another %vector.
* @param x A %vector of the same element and allocator types.
@ -685,7 +685,7 @@ namespace __gnu_norm
std::swap(this->_M_finish, __x._M_finish);
std::swap(this->_M_end_of_storage, __x._M_end_of_storage);
}
/**
* Erases all the elements. Note that this function only erases the
* elements, and that if the elements themselves are pointers, the
@ -694,7 +694,7 @@ namespace __gnu_norm
*/
void
clear() { erase(begin(), end()); }
protected:
/**
* @if maint
@ -719,10 +719,10 @@ namespace __gnu_norm
__throw_exception_again;
}
}
// Internal constructor functions follow.
// Called by the range constructor to implement [23.1.1]/9
template<typename _Integer>
void
@ -730,10 +730,10 @@ namespace __gnu_norm
{
this->_M_start = _M_allocate(__n);
this->_M_end_of_storage = this->_M_start + __n;
this->_M_finish = std::uninitialized_fill_n(this->_M_start,
this->_M_finish = std::uninitialized_fill_n(this->_M_start,
__n, __value);
}
// Called by the range constructor to implement [23.1.1]/9
template<typename _InputIterator>
void
@ -744,7 +744,7 @@ namespace __gnu_norm
_IterCategory;
_M_range_initialize(__first, __last, _IterCategory());
}
// Called by the second initialize_dispatch above
template<typename _InputIterator>
void
@ -754,10 +754,10 @@ namespace __gnu_norm
for ( ; __first != __last; ++__first)
push_back(*__first);
}
// Called by the second initialize_dispatch above
template<typename _ForwardIterator>
void
void
_M_range_initialize(_ForwardIterator __first,
_ForwardIterator __last, forward_iterator_tag)
{
@ -767,11 +767,11 @@ namespace __gnu_norm
this->_M_finish = std::uninitialized_copy(__first, __last,
this->_M_start);
}
// Internal assign functions follow. The *_aux functions do the actual
// assignment work for the range versions.
// Called by the range assign to implement [23.1.1]/9
template<typename _Integer>
void
@ -780,38 +780,38 @@ namespace __gnu_norm
_M_fill_assign(static_cast<size_type>(__n),
static_cast<value_type>(__val));
}
// Called by the range assign to implement [23.1.1]/9
template<typename _InputIterator>
void
_M_assign_dispatch(_InputIterator __first, _InputIterator __last,
_M_assign_dispatch(_InputIterator __first, _InputIterator __last,
__false_type)
{
typedef typename iterator_traits<_InputIterator>::iterator_category
_IterCategory;
_M_assign_aux(__first, __last, _IterCategory());
}
// Called by the second assign_dispatch above
template<typename _InputIterator>
void
void
_M_assign_aux(_InputIterator __first, _InputIterator __last,
input_iterator_tag);
// Called by the second assign_dispatch above
template<typename _ForwardIterator>
void
void
_M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag);
// Called by assign(n,t), and the range assign when it turns out
// to be the same thing.
void
_M_fill_assign(size_type __n, const value_type& __val);
// Internal insert functions follow.
// Called by the range insert to implement [23.1.1]/9
template<typename _Integer>
void
@ -821,7 +821,7 @@ namespace __gnu_norm
_M_fill_insert(__pos, static_cast<size_type>(__n),
static_cast<value_type>(__val));
}
// Called by the range insert to implement [23.1.1]/9
template<typename _InputIterator>
void
@ -832,30 +832,30 @@ namespace __gnu_norm
_IterCategory;
_M_range_insert(__pos, __first, __last, _IterCategory());
}
// Called by the second insert_dispatch above
template<typename _InputIterator>
void
_M_range_insert(iterator __pos, _InputIterator __first,
_M_range_insert(iterator __pos, _InputIterator __first,
_InputIterator __last, input_iterator_tag);
// Called by the second insert_dispatch above
template<typename _ForwardIterator>
void
_M_range_insert(iterator __pos, _ForwardIterator __first,
_M_range_insert(iterator __pos, _ForwardIterator __first,
_ForwardIterator __last, forward_iterator_tag);
// Called by insert(p,n,x), and the range insert when it turns out to be
// the same thing.
void
_M_fill_insert(iterator __pos, size_type __n, const value_type& __x);
// Called by insert(p,x)
void
_M_insert_aux(iterator __position, const value_type& __x);
};
/**
* @brief Vector equality comparison.
* @param x A %vector.
@ -873,7 +873,7 @@ namespace __gnu_norm
return __x.size() == __y.size() &&
std::equal(__x.begin(), __x.end(), __y.begin());
}
/**
* @brief Vector ordering relation.
* @param x A %vector.
@ -892,31 +892,31 @@ namespace __gnu_norm
return std::lexicographical_compare(__x.begin(), __x.end(),
__y.begin(), __y.end());
}
/// Based on operator==
template<typename _Tp, typename _Alloc>
inline bool
operator!=(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y)
{ return !(__x == __y); }
/// Based on operator<
template<typename _Tp, typename _Alloc>
inline bool
operator>(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y)
{ return __y < __x; }
/// Based on operator<
template<typename _Tp, typename _Alloc>
inline bool
operator<=(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y)
{ return !(__y < __x); }
/// Based on operator<
template<typename _Tp, typename _Alloc>
inline bool
operator>=(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y)
{ return !(__x < __y); }
/// See std::vector::swap().
template<typename _Tp, typename _Alloc>
inline void

View File

@ -42,9 +42,9 @@
namespace std
{
/// Provides input iterator semantics for streams.
template<typename _Tp, typename _CharT = char,
typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>
class istream_iterator
template<typename _Tp, typename _CharT = char,
typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>
class istream_iterator
: public iterator<input_iterator_tag, _Tp, _Dist, const _Tp*, const _Tp&>
{
public:
@ -53,9 +53,9 @@ namespace std
typedef basic_istream<_CharT, _Traits> istream_type;
private:
istream_type* _M_stream;
_Tp _M_value;
bool _M_ok;
istream_type* _M_stream;
_Tp _M_value;
bool _M_ok;
public:
/// Construct end of input stream iterator.
@ -67,14 +67,14 @@ namespace std
: _M_stream(&__s)
{ _M_read(); }
istream_iterator(const istream_iterator& __obj)
: _M_stream(__obj._M_stream), _M_value(__obj._M_value),
_M_ok(__obj._M_ok)
istream_iterator(const istream_iterator& __obj)
: _M_stream(__obj._M_stream), _M_value(__obj._M_value),
_M_ok(__obj._M_ok)
{ }
const _Tp&
operator*() const
{
operator*() const
{
__glibcxx_requires_cond(_M_ok,
_M_message(__gnu_debug::__msg_deref_istream)
._M_iterator(*this));
@ -84,34 +84,34 @@ namespace std
const _Tp*
operator->() const { return &(operator*()); }
istream_iterator&
operator++()
{
__glibcxx_requires_cond(_M_ok,
_M_message(__gnu_debug::__msg_inc_istream)
._M_iterator(*this));
_M_read();
return *this;
}
istream_iterator
operator++(int)
istream_iterator&
operator++()
{
__glibcxx_requires_cond(_M_ok,
_M_message(__gnu_debug::__msg_inc_istream)
._M_iterator(*this));
._M_iterator(*this));
_M_read();
return *this;
}
istream_iterator
operator++(int)
{
__glibcxx_requires_cond(_M_ok,
_M_message(__gnu_debug::__msg_inc_istream)
._M_iterator(*this));
istream_iterator __tmp = *this;
_M_read();
return __tmp;
}
bool
bool
_M_equal(const istream_iterator& __x) const
{ return (_M_ok == __x._M_ok) && (!_M_ok || _M_stream == __x._M_stream); }
private:
void
_M_read()
private:
void
_M_read()
{
_M_ok = (_M_stream && *_M_stream) ? true : false;
if (_M_ok)
@ -121,19 +121,19 @@ namespace std
}
}
};
/// Return true if x and y are both end or not end, or x and y are the same.
template<typename _Tp, typename _CharT, typename _Traits, typename _Dist>
inline bool
inline bool
operator==(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y)
const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y)
{ return __x._M_equal(__y); }
/// Return false if x and y are both end or not end, or x and y are the same.
template <class _Tp, class _CharT, class _Traits, class _Dist>
inline bool
inline bool
operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y)
const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y)
{ return !__x._M_equal(__y); }
/**
@ -147,9 +147,9 @@ namespace std
* @param CharT The ostream char_type.
* @param Traits The ostream char_traits.
*/
template<typename _Tp, typename _CharT = char,
template<typename _Tp, typename _CharT = char,
typename _Traits = char_traits<_CharT> >
class ostream_iterator
class ostream_iterator
: public iterator<output_iterator_tag, void, void, void, void>
{
public:
@ -161,8 +161,8 @@ namespace std
//@}
private:
ostream_type* _M_stream;
const _CharT* _M_string;
ostream_type* _M_stream;
const _CharT* _M_string;
public:
/// Construct from an ostream.
@ -178,7 +178,7 @@ namespace std
* @param s Underlying ostream to write to.
* @param c CharT delimiter string to insert.
*/
ostream_iterator(ostream_type& __s, const _CharT* __c)
ostream_iterator(ostream_type& __s, const _CharT* __c)
: _M_stream(&__s), _M_string(__c) { }
/// Copy constructor.
@ -187,9 +187,9 @@ namespace std
/// Writes @a value to underlying ostream using operator<<. If
/// constructed with delimiter string, writes delimiter to ostream.
ostream_iterator&
operator=(const _Tp& __value)
{
ostream_iterator&
operator=(const _Tp& __value)
{
__glibcxx_requires_cond(_M_stream != 0,
_M_message(__gnu_debug::__msg_output_ostream)
._M_iterator(*this));
@ -197,18 +197,18 @@ namespace std
if (_M_string) *_M_stream << _M_string;
return *this;
}
ostream_iterator&
ostream_iterator&
operator*()
{ return *this; }
ostream_iterator&
ostream_iterator&
operator++()
{ return *this; }
ostream_iterator&
{ return *this; }
ostream_iterator&
operator++(int)
{ return *this; }
{ return *this; }
};
} // namespace std
#endif

View File

@ -37,7 +37,7 @@
#pragma GCC system_header
namespace std
namespace std
{
template<typename _CharT, typename _Traits>
streamsize
@ -57,10 +57,10 @@ namespace std
__s += __len;
this->gbump(__len);
}
if (__ret < __n)
{
const int_type __c = this->uflow();
const int_type __c = this->uflow();
if (!traits_type::eq_int_type(__c, traits_type::eof()))
{
traits_type::assign(*__s++, traits_type::to_char_type(__c));
@ -114,7 +114,7 @@ namespace std
template<typename _CharT, typename _Traits>
streamsize
__copy_streambufs(basic_streambuf<_CharT, _Traits>* __sbin,
basic_streambuf<_CharT, _Traits>* __sbout)
basic_streambuf<_CharT, _Traits>* __sbout)
{
streamsize __ret = 0;
typename _Traits::int_type __c = __sbin->sgetc();
@ -130,7 +130,7 @@ namespace std
break;
__c = __sbin->underflow();
}
else
else
{
__c = __sbout->sputc(_Traits::to_char_type(__c));
if (_Traits::eq_int_type(__c, _Traits::eof()))
@ -143,21 +143,21 @@ namespace std
}
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
// which are defined via explicit instantiations elsewhere.
// NB: This syntax is a GNU extension.
#if _GLIBCXX_EXTERN_TEMPLATE
extern template class basic_streambuf<char>;
extern template
streamsize
__copy_streambufs(basic_streambuf<char>*, basic_streambuf<char>*);
__copy_streambufs(basic_streambuf<char>*, basic_streambuf<char>*);
#ifdef _GLIBCXX_USE_WCHAR_T
extern template class basic_streambuf<wchar_t>;
extern template
streamsize
__copy_streambufs(basic_streambuf<wchar_t>*, basic_streambuf<wchar_t>*);
__copy_streambufs(basic_streambuf<wchar_t>*, basic_streambuf<wchar_t>*);
#endif
#endif
} // namespace std
#endif
#endif

View File

@ -50,35 +50,35 @@ namespace std
template<typename _CharT, typename _Traits>
class istreambuf_iterator
: public iterator<input_iterator_tag, _CharT, typename _Traits::off_type,
_CharT*, _CharT&>
_CharT*, _CharT&>
{
public:
// Types:
//@{
/// Public typedefs
typedef _CharT char_type;
typedef _Traits traits_type;
typedef typename _Traits::int_type int_type;
typedef basic_streambuf<_CharT, _Traits> streambuf_type;
typedef basic_istream<_CharT, _Traits> istream_type;
typedef _CharT char_type;
typedef _Traits traits_type;
typedef typename _Traits::int_type int_type;
typedef basic_streambuf<_CharT, _Traits> streambuf_type;
typedef basic_istream<_CharT, _Traits> istream_type;
//@}
private:
// 24.5.3 istreambuf_iterator
// p 1
// 24.5.3 istreambuf_iterator
// p 1
// If the end of stream is reached (streambuf_type::sgetc()
// returns traits_type::eof()), the iterator becomes equal to
// the "end of stream" iterator value.
// NB: This implementation assumes the "end of stream" value
// is EOF, or -1.
mutable streambuf_type* _M_sbuf;
int_type _M_c;
mutable streambuf_type* _M_sbuf;
int_type _M_c;
public:
/// Construct end of input stream iterator.
istreambuf_iterator() throw()
istreambuf_iterator() throw()
: _M_sbuf(0), _M_c(traits_type::eof()) { }
/// Construct start of input stream iterator.
istreambuf_iterator(istream_type& __s) throw()
: _M_sbuf(__s.rdbuf()), _M_c(traits_type::eof()) { }
@ -86,36 +86,36 @@ namespace std
/// Construct start of streambuf iterator.
istreambuf_iterator(streambuf_type* __s) throw()
: _M_sbuf(__s), _M_c(traits_type::eof()) { }
/// Return the current character pointed to by iterator. This returns
/// streambuf.sgetc(). It cannot be assigned. NB: The result of
/// operator*() on an end of stream is undefined.
char_type
char_type
operator*() const
{
{
#ifdef _GLIBCXX_DEBUG_PEDANTIC
// Dereferencing a past-the-end istreambuf_iterator is a
// libstdc++ extension
__glibcxx_requires_cond(!_M_at_eof(),
_M_message(__gnu_debug::__msg_deref_istreambuf)
._M_iterator(*this));
._M_iterator(*this));
#endif
return traits_type::to_char_type(_M_get());
return traits_type::to_char_type(_M_get());
}
/// Advance the iterator. Calls streambuf.sbumpc().
istreambuf_iterator&
istreambuf_iterator&
operator++()
{
{
__glibcxx_requires_cond(!_M_at_eof(),
_M_message(__gnu_debug::__msg_inc_istreambuf)
._M_iterator(*this));
._M_iterator(*this));
const int_type __eof = traits_type::eof();
if (_M_sbuf && traits_type::eq_int_type(_M_sbuf->sbumpc(), __eof))
_M_sbuf = 0;
else
_M_c = __eof;
return *this;
return *this;
}
/// Advance the iterator. Calls streambuf.sbumpc().
@ -124,24 +124,24 @@ namespace std
{
__glibcxx_requires_cond(!_M_at_eof(),
_M_message(__gnu_debug::__msg_inc_istreambuf)
._M_iterator(*this));
._M_iterator(*this));
const int_type __eof = traits_type::eof();
istreambuf_iterator __old = *this;
if (_M_sbuf
&& traits_type::eq_int_type((__old._M_c = _M_sbuf->sbumpc()),
&& traits_type::eq_int_type((__old._M_c = _M_sbuf->sbumpc()),
__eof))
_M_sbuf = 0;
else
_M_c = __eof;
return __old;
return __old;
}
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 110 istreambuf_iterator::equal not const
// NB: there is also number 111 (NAD, Future) pending on this function.
/// Return true both iterators are end or both are not end.
bool
bool
equal(const istreambuf_iterator& __b) const
{
const bool __thiseof = _M_at_eof();
@ -150,13 +150,13 @@ namespace std
}
private:
int_type
int_type
_M_get() const
{
{
const int_type __eof = traits_type::eof();
int_type __ret = __eof;
if (_M_sbuf)
{
{
if (!traits_type::eq_int_type(_M_c, __eof))
__ret = _M_c;
else if (traits_type::eq_int_type((__ret = _M_sbuf->sgetc()),
@ -166,7 +166,7 @@ namespace std
return __ret;
}
bool
bool
_M_at_eof() const
{
const int_type __eof = traits_type::eof();
@ -175,13 +175,13 @@ namespace std
};
template<typename _CharT, typename _Traits>
inline bool
inline bool
operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
const istreambuf_iterator<_CharT, _Traits>& __b)
{ return __a.equal(__b); }
template<typename _CharT, typename _Traits>
inline bool
inline bool
operator!=(const istreambuf_iterator<_CharT, _Traits>& __a,
const istreambuf_iterator<_CharT, _Traits>& __b)
{ return !__a.equal(__b); }
@ -202,49 +202,49 @@ namespace std
//@}
private:
streambuf_type* _M_sbuf;
bool _M_failed;
streambuf_type* _M_sbuf;
bool _M_failed;
public:
/// Construct output iterator from ostream.
ostreambuf_iterator(ostream_type& __s) throw ()
: _M_sbuf(__s.rdbuf()), _M_failed(!_M_sbuf) { }
/// Construct output iterator from streambuf.
ostreambuf_iterator(streambuf_type* __s) throw ()
: _M_sbuf(__s), _M_failed(!_M_sbuf) { }
/// Write character to streambuf. Calls streambuf.sputc().
ostreambuf_iterator&
ostreambuf_iterator&
operator=(_CharT __c)
{
if (!_M_failed &&
if (!_M_failed &&
_Traits::eq_int_type(_M_sbuf->sputc(__c), _Traits::eof()))
_M_failed = true;
return *this;
}
/// Return *this.
ostreambuf_iterator&
ostreambuf_iterator&
operator*()
{ return *this; }
/// Return *this.
ostreambuf_iterator&
ostreambuf_iterator&
operator++(int)
{ return *this; }
/// Return *this.
ostreambuf_iterator&
ostreambuf_iterator&
operator++()
{ return *this; }
/// Return true if previous operator=() failed.
bool
bool
failed() const throw()
{ return _M_failed; }
ostreambuf_iterator&
ostreambuf_iterator&
_M_put(const _CharT* __ws, streamsize __len)
{
if (__builtin_expect(!_M_failed, true)

View File

@ -45,16 +45,16 @@
namespace std
{
template<typename _Alloc>
template<typename _Alloc>
class allocator;
template<class _CharT>
struct char_traits;
template<typename _CharT, typename _Traits = char_traits<_CharT>,
template<typename _CharT, typename _Traits = char_traits<_CharT>,
typename _Alloc = allocator<_CharT> >
class basic_string;
template<> struct char_traits<char>;
typedef basic_string<char> string;

View File

@ -74,10 +74,10 @@ attain their correct values by one of these means:
EXAMPLE:
//Copy an array of elements which have non-trivial copy constructors
template <class _Tp> void
template <class _Tp> void
copy(_Tp* __source,_Tp* __destination,int __n,__false_type);
//Copy an array of elements which have trivial copy constructors. Use memcpy.
template <class _Tp> void
template <class _Tp> void
copy(_Tp* __source,_Tp* __destination,int __n,__true_type);
//Copy an array of any type by using the most efficient copy mechanism
@ -92,7 +92,7 @@ struct __false_type {};
template <class _Tp>
struct __type_traits
{
{
typedef __true_type this_dummy_member_must_be_first;
/* Do not remove this member. It informs a compiler which
automatically specializes __type_traits that this
@ -101,7 +101,7 @@ template <class _Tp>
called __type_traits for something unrelated. */
/* The following restrictions should be observed for the sake of
compilers which automatically produce type specific specializations
compilers which automatically produce type specific specializations
of this class:
- You may reorder the members below if you wish
- You may remove any of the members below if you wish
@ -109,7 +109,7 @@ template <class _Tp>
name change in the compiler
- Members you add will be treated like regular members unless
you add the appropriate support in the compiler. */
typedef __false_type has_trivial_default_constructor;
typedef __false_type has_trivial_copy_constructor;
@ -291,7 +291,7 @@ template <class _Tp>
typedef __true_type is_POD_type;
};
// The following could be written in terms of numeric_limits.
// The following could be written in terms of numeric_limits.
// We're doing it separately to reduce the number of dependencies.
template <class _Tp>

View File

@ -41,35 +41,35 @@
namespace std
{
//
// gslice_array closure.
//
template<class _Dom> class _GBase {
public:
typedef typename _Dom::value_type value_type;
_GBase (const _Dom& __e, const valarray<size_t>& __i)
: _M_expr (__e), _M_index(__i) {}
value_type operator[] (size_t __i) const
{ return _M_expr[_M_index[__i]]; }
size_t size () const { return _M_index.size(); }
private:
const _Dom& _M_expr;
const valarray<size_t>& _M_index;
};
template<typename _Tp> class _GBase<_Array<_Tp> > {
public:
typedef _Tp value_type;
_GBase (_Array<_Tp> __a, const valarray<size_t>& __i)
: _M_array (__a), _M_index(__i) {}
value_type operator[] (size_t __i) const
{ return _M_array._M_data[_M_index[__i]]; }
size_t size () const { return _M_index.size(); }
private:
const _Array<_Tp> _M_array;
const valarray<size_t>& _M_index;
@ -104,9 +104,9 @@ namespace std
value_type operator[] (size_t __i) const
{ return _M_expr[_M_index[__i]]; }
size_t size() const { return _M_index.size(); }
private:
const _Dom& _M_expr;
const _Dom& _M_expr;
const valarray<size_t>& _M_index;
};
@ -129,23 +129,23 @@ namespace std
//
// class _Expr
//
template<class _Clos, typename _Tp>
//
template<class _Clos, typename _Tp>
class _Expr
{
public:
typedef _Tp value_type;
_Expr(const _Clos&);
const _Clos& operator()() const;
value_type operator[](size_t) const;
valarray<value_type> operator[](slice) const;
valarray<value_type> operator[](const gslice&) const;
valarray<value_type> operator[](const valarray<bool>&) const;
valarray<value_type> operator[](const valarray<size_t>&) const;
_Expr<_UnClos<__unary_plus,std::_Expr,_Clos>, value_type>
operator+() const;
@ -160,7 +160,7 @@ namespace std
size_t size() const;
value_type sum() const;
valarray<value_type> shift(int) const;
valarray<value_type> cshift(int) const;
@ -169,15 +169,15 @@ namespace std
valarray<value_type> apply(value_type (*)(const value_type&)) const;
valarray<value_type> apply(value_type (*)(value_type)) const;
private:
const _Clos _M_closure;
};
template<class _Clos, typename _Tp>
inline
_Expr<_Clos,_Tp>::_Expr(const _Clos& __c) : _M_closure(__c) {}
template<class _Clos, typename _Tp>
inline const _Clos&
_Expr<_Clos,_Tp>::operator()() const
@ -192,22 +192,22 @@ namespace std
inline valarray<_Tp>
_Expr<_Clos,_Tp>::operator[](slice __s) const
{ return _M_closure[__s]; }
template<class _Clos, typename _Tp>
inline valarray<_Tp>
_Expr<_Clos,_Tp>::operator[](const gslice& __gs) const
{ return _M_closure[__gs]; }
template<class _Clos, typename _Tp>
inline valarray<_Tp>
_Expr<_Clos,_Tp>::operator[](const valarray<bool>& __m) const
{ return _M_closure[__m]; }
template<class _Clos, typename _Tp>
inline valarray<_Tp>
_Expr<_Clos,_Tp>::operator[](const valarray<size_t>& __i) const
{ return _M_closure[__i]; }
template<class _Clos, typename _Tp>
inline size_t
_Expr<_Clos,_Tp>::size() const { return _M_closure.size (); }
@ -226,7 +226,7 @@ namespace std
inline valarray<_Tp>
_Expr<_Clos, _Tp>::apply(_Tp __f(const _Tp&)) const
{ return valarray<_Tp>(_M_closure).apply(__f); }
template<class _Clos, typename _Tp>
inline valarray<_Tp>
_Expr<_Clos, _Tp>::apply(_Tp __f(_Tp)) const
@ -238,9 +238,9 @@ namespace std
_Expr<_Clos,_Tp>::sum() const
{
size_t __n = _M_closure.size();
if (__n == 0)
if (__n == 0)
return _Tp();
else
else
{
_Tp __s = _M_closure[--__n];
while (__n != 0)
@ -258,7 +258,7 @@ namespace std
inline _Tp
_Expr<_Clos, _Tp>::max() const
{ return __valarray_max(_M_closure); }
template<class _Dom, typename _Tp>
inline _Expr<_UnClos<__logical_not,_Expr,_Dom>, bool>
_Expr<_Dom,_Tp>::operator!() const
@ -386,14 +386,14 @@ operator _Op(const valarray<typename _Dom::value_type>& __v, \
_DEFINE_EXPR_UNARY_FUNCTION(abs)
_DEFINE_EXPR_UNARY_FUNCTION(cos)
_DEFINE_EXPR_UNARY_FUNCTION(acos)
_DEFINE_EXPR_UNARY_FUNCTION(cosh)
_DEFINE_EXPR_UNARY_FUNCTION(cosh)
_DEFINE_EXPR_UNARY_FUNCTION(sin)
_DEFINE_EXPR_UNARY_FUNCTION(asin)
_DEFINE_EXPR_UNARY_FUNCTION(sinh)
_DEFINE_EXPR_UNARY_FUNCTION(sinh)
_DEFINE_EXPR_UNARY_FUNCTION(tan)
_DEFINE_EXPR_UNARY_FUNCTION(tanh)
_DEFINE_EXPR_UNARY_FUNCTION(atan)
_DEFINE_EXPR_UNARY_FUNCTION(exp)
_DEFINE_EXPR_UNARY_FUNCTION(exp)
_DEFINE_EXPR_UNARY_FUNCTION(log)
_DEFINE_EXPR_UNARY_FUNCTION(log10)
_DEFINE_EXPR_UNARY_FUNCTION(sqrt)

View File

@ -51,12 +51,12 @@ namespace std
//
// Helper functions on raw pointers
//
// We get memory by the old fashion way
inline void*
__valarray_get_memory(size_t __n)
{ return operator new(__n); }
template<typename _Tp>
inline _Tp*__restrict__
__valarray_get_storage(size_t __n)
@ -98,7 +98,7 @@ namespace std
_Array_default_ctor<_Tp, __is_fundamental<_Tp>::_M_type>::
_S_do_it(__b, __e);
}
// Turn a raw-memory into an array of _Tp filled with __t
// This is the required in valarray<T> v(n, t). Also
// used in valarray<>::resize().
@ -196,13 +196,13 @@ namespace std
if (!__is_fundamental<_Tp>::_M_type)
while (__b != __e) { __b->~_Tp(); ++__b; }
}
// Fill a plain array __a[<__n>] with __t
template<typename _Tp>
inline void
__valarray_fill (_Tp* __restrict__ __a, size_t __n, const _Tp& __t)
{ while (__n--) *__a++ = __t; }
// fill strided array __a[<__n-1 : __s>] with __t
template<typename _Tp>
inline void
@ -216,7 +216,7 @@ namespace std
__valarray_fill(_Tp* __restrict__ __a, const size_t* __restrict__ __i,
size_t __n, const _Tp& __t)
{ for (size_t __j=0; __j<__n; ++__j, ++__i) __a[*__i] = __t; }
// copy plain array __a[<__n>] in __b[<__n>]
// For non-fundamental types, it is wrong to say 'memcpy()'
template<typename _Tp, bool>
@ -224,7 +224,7 @@ namespace std
{
inline static void
_S_do_it(const _Tp* __restrict__ __a, size_t __n, _Tp* __restrict__ __b)
{ while (__n--) *__b++ = *__a++; }
{ while (__n--) *__b++ = *__a++; }
};
template<typename _Tp>
@ -270,7 +270,7 @@ namespace std
__dst[__i * __s2] = __src [ __i * __s1];
}
// Copy an indexed array __a[__i[<__n>]] in plain array __b[<__n>]
template<typename _Tp>
inline void
@ -341,7 +341,7 @@ namespace std
}
return __r;
}
template<typename _Ta>
inline typename _Ta::value_type
__valarray_max(const _Ta& __a)
@ -357,13 +357,13 @@ namespace std
}
return __r;
}
//
// Helper class _Array, first layer of valarray abstraction.
// All operations on valarray should be forwarded to this class
// whenever possible. -- gdr
//
template<typename _Tp>
struct _Array
{
@ -376,20 +376,20 @@ namespace std
_Tp* const __restrict__ _M_data;
};
template<typename _Tp>
inline void
__valarray_fill (_Array<_Tp> __a, size_t __n, const _Tp& __t)
{ std::__valarray_fill (__a._M_data, __n, __t); }
template<typename _Tp>
inline void
__valarray_fill (_Array<_Tp> __a, size_t __n, size_t __s, const _Tp& __t)
{ std::__valarray_fill (__a._M_data, __n, __s, __t); }
template<typename _Tp>
inline void
__valarray_fill (_Array<_Tp> __a, _Array<size_t> __i,
__valarray_fill (_Array<_Tp> __a, _Array<size_t> __i,
size_t __n, const _Tp& __t)
{ std::__valarray_fill (__a._M_data, __i._M_data, __n, __t); }
@ -398,7 +398,7 @@ namespace std
inline void
__valarray_copy(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b)
{ std::__valarray_copy(__a._M_data, __n, __b._M_data); }
// Copy strided array __a[<__n : __s>] in plain __b[<__n>]
template<typename _Tp>
inline void
@ -419,18 +419,18 @@ namespace std
_Array<_Tp> __b, size_t __s2)
{ std::__valarray_copy(__a._M_data, __n, __s1, __b._M_data, __s2); }
// Copy an indexed array __a[__i[<__n>]] in plain array __b[<__n>]
template<typename _Tp>
inline void
__valarray_copy(_Array<_Tp> __a, _Array<size_t> __i,
__valarray_copy(_Array<_Tp> __a, _Array<size_t> __i,
_Array<_Tp> __b, size_t __n)
{ std::__valarray_copy(__a._M_data, __i._M_data, __b._M_data, __n); }
// Copy a plain array __a[<__n>] in an indexed array __b[__i[<__n>]]
template<typename _Tp>
inline void
__valarray_copy(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b,
__valarray_copy(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b,
_Array<size_t> __i)
{ std::__valarray_copy(__a._M_data, __n, __b._M_data, __i._M_data); }
@ -454,14 +454,14 @@ namespace std
template<typename _Tp>
inline
_Array<_Tp>::_Array (_Tp* const __restrict__ __p) : _M_data (__p) {}
template<typename _Tp>
inline _Array<_Tp>::_Array (const valarray<_Tp>& __v)
inline _Array<_Tp>::_Array (const valarray<_Tp>& __v)
: _M_data (__v._M_data) {}
template<typename _Tp>
inline
_Array<_Tp>::_Array (const _Tp* __restrict__ __b, size_t __s)
_Array<_Tp>::_Array (const _Tp* __restrict__ __b, size_t __s)
: _M_data(__valarray_get_storage<_Tp>(__s))
{ std::__valarray_copy_construct(__b, __s, _M_data); }
@ -490,7 +490,7 @@ _Array_augmented_##_Name (_Array<_Tp> __a, size_t __n, _Array<_Tp> __b) \
\
template<typename _Tp, class _Dom> \
void \
_Array_augmented_##_Name (_Array<_Tp> __a, \
_Array_augmented_##_Name (_Array<_Tp> __a, \
const _Expr<_Dom,_Tp>& __e, size_t __n) \
{ \
_Tp* __p (__a._M_data); \
@ -499,9 +499,9 @@ _Array_augmented_##_Name (_Array<_Tp> __a, \
\
template<typename _Tp> \
inline void \
_Array_augmented_##_Name (_Array<_Tp> __a, size_t __n, size_t __s, \
_Array_augmented_##_Name (_Array<_Tp> __a, size_t __n, size_t __s, \
_Array<_Tp> __b) \
{ \
{ \
_Tp* __q (__b._M_data); \
for (_Tp* __p=__a._M_data; __p<__a._M_data+__s*__n; __p+=__s, ++__q) \
*__p _Op##= *__q; \
@ -509,7 +509,7 @@ _Array_augmented_##_Name (_Array<_Tp> __a, size_t __n, size_t __s, \
\
template<typename _Tp> \
inline void \
_Array_augmented_##_Name (_Array<_Tp> __a, _Array<_Tp> __b, \
_Array_augmented_##_Name (_Array<_Tp> __a, _Array<_Tp> __b, \
size_t __n, size_t __s) \
{ \
_Tp* __q (__b._M_data); \
@ -552,7 +552,7 @@ _Array_augmented_##_Name (_Array<_Tp> __a, _Array<size_t> __i, \
const _Expr<_Dom, _Tp>& __e, size_t __n) \
{ \
size_t* __j (__i._M_data); \
for (size_t __k=0; __k<__n; ++__k, ++__j) \
for (size_t __k=0; __k<__n; ++__k, ++__j) \
__a._M_data[*__j] _Op##= __e[__k]; \
} \
\
@ -611,15 +611,15 @@ _Array_augmented_##_Name (_Array<_Tp> __a, _Array<bool> __m, \
_DEFINE_ARRAY_FUNCTION(%, __modulus)
_DEFINE_ARRAY_FUNCTION(^, __bitwise_xor)
_DEFINE_ARRAY_FUNCTION(|, __bitwise_or)
_DEFINE_ARRAY_FUNCTION(&, __bitwise_and)
_DEFINE_ARRAY_FUNCTION(&, __bitwise_and)
_DEFINE_ARRAY_FUNCTION(<<, __shift_left)
_DEFINE_ARRAY_FUNCTION(>>, __shift_right)
#undef _DEFINE_VALARRAY_FUNCTION
#undef _DEFINE_VALARRAY_FUNCTION
} // namespace std
#ifndef _GLIBCXX_EXPORT_TEMPLATE
# include <bits/valarray_array.tcc>
# include <bits/valarray_array.tcc>
#endif
#endif /* _ARRAY_H */

View File

@ -29,21 +29,21 @@
// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
#ifndef _VALARRAY_ARRAY_TCC
#ifndef _VALARRAY_ARRAY_TCC
#define _VALARRAY_ARRAY_TCC 1
namespace std
{
template<typename _Tp>
void
__valarray_fill(_Array<_Tp> __a, size_t __n, _Array<bool> __m,
__valarray_fill(_Array<_Tp> __a, size_t __n, _Array<bool> __m,
const _Tp& __t)
{
_Tp* __p = __a._M_data;
bool* __ok (__m._M_data);
for (size_t __i=0; __i < __n; ++__i, ++__ok, ++__p)
for (size_t __i=0; __i < __n; ++__i, ++__ok, ++__p)
{
while (!*__ok)
while (!*__ok)
{
++__ok;
++__p;
@ -51,18 +51,18 @@ namespace std
*__p = __t;
}
}
template<typename _Tp>
void
__valarray_copy(_Array<_Tp> __a, _Array<bool> __m, _Array<_Tp> __b,
__valarray_copy(_Array<_Tp> __a, _Array<bool> __m, _Array<_Tp> __b,
size_t __n)
{
_Tp* __p (__a._M_data);
bool* __ok (__m._M_data);
for (_Tp* __q = __b._M_data; __q < __b._M_data + __n;
++__q, ++__ok, ++__p)
for (_Tp* __q = __b._M_data; __q < __b._M_data + __n;
++__q, ++__ok, ++__p)
{
while (! *__ok)
while (! *__ok)
{
++__ok;
++__p;
@ -73,15 +73,15 @@ namespace std
template<typename _Tp>
void
__valarray_copy(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b,
__valarray_copy(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b,
_Array<bool> __m)
{
_Tp* __q (__b._M_data);
bool* __ok (__m._M_data);
for (_Tp* __p = __a._M_data; __p < __a._M_data+__n;
++__p, ++__ok, ++__q)
for (_Tp* __p = __a._M_data; __p < __a._M_data+__n;
++__p, ++__ok, ++__q)
{
while (! *__ok)
while (! *__ok)
{
++__ok;
++__q;
@ -95,40 +95,40 @@ namespace std
__valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n, _Array<_Tp> __a)
{
_Tp* __p (__a._M_data);
for (size_t __i = 0; __i < __n; ++__i, ++__p)
for (size_t __i = 0; __i < __n; ++__i, ++__p)
*__p = __e[__i];
}
template<typename _Tp, class _Dom>
void
__valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n,
__valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n,
_Array<_Tp> __a, size_t __s)
{
_Tp* __p (__a._M_data);
for (size_t __i = 0; __i < __n; ++__i, __p += __s)
for (size_t __i = 0; __i < __n; ++__i, __p += __s)
*__p = __e[__i];
}
template<typename _Tp, class _Dom>
void
__valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n,
__valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n,
_Array<_Tp> __a, _Array<size_t> __i)
{
size_t* __j (__i._M_data);
for (size_t __k = 0; __k < __n; ++__k, ++__j)
for (size_t __k = 0; __k < __n; ++__k, ++__j)
__a._M_data[*__j] = __e[__k];
}
template<typename _Tp, class _Dom>
void
__valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n,
__valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n,
_Array<_Tp> __a, _Array<bool> __m)
{
bool* __ok (__m._M_data);
_Tp* __p (__a._M_data);
for (size_t __i = 0; __i < __n; ++__i, ++__ok, ++__p)
for (size_t __i = 0; __i < __n; ++__i, ++__ok, ++__p)
{
while (! *__ok)
while (! *__ok)
{
++__ok;
++__p;
@ -136,7 +136,7 @@ namespace std
*__p = __e[__i];
}
}
template<typename _Tp, class _Dom>
void
@ -144,7 +144,7 @@ namespace std
_Array<_Tp> __a)
{
_Tp* __p (__a._M_data);
for (size_t __i = 0; __i < __n; ++__i, ++__p)
for (size_t __i = 0; __i < __n; ++__i, ++__p)
new (__p) _Tp(__e[__i]);
}
@ -158,7 +158,7 @@ namespace std
bool* __ok (__m._M_data);
for (_Tp* __q = __b._M_data; __q < __b._M_data+__n; ++__q, ++__ok, ++__p)
{
while (! *__ok)
while (! *__ok)
{
++__ok;
++__p;

View File

@ -51,7 +51,7 @@ namespace std
// At some point we use partial specialization to remove one level
// template nesting due to _Expr<>
//
// This class is NOT defined. It doesn't need to.
template<typename _Tp1, typename _Tp2> class _Constant;
@ -386,11 +386,11 @@ namespace std
//
template<typename _Dom, typename _Arg>
class _FunBase
class _FunBase
{
public:
typedef typename _Dom::value_type value_type;
_FunBase(const _Dom& __e, value_type __f(_Arg))
: _M_expr(__e), _M_func(__f) {}
@ -405,12 +405,12 @@ namespace std
};
template<class _Dom>
struct _ValFunClos<_Expr,_Dom> : _FunBase<_Dom, typename _Dom::value_type>
struct _ValFunClos<_Expr,_Dom> : _FunBase<_Dom, typename _Dom::value_type>
{
typedef _FunBase<_Dom, typename _Dom::value_type> _Base;
typedef typename _Base::value_type value_type;
typedef value_type _Tp;
_ValFunClos(const _Dom& __e, _Tp __f(_Tp)) : _Base(__e, __f) {}
};
@ -419,32 +419,32 @@ namespace std
{
typedef _FunBase<valarray<_Tp>, _Tp> _Base;
typedef _Tp value_type;
_ValFunClos(const valarray<_Tp>& __v, _Tp __f(_Tp)) : _Base(__v, __f) {}
};
template<class _Dom>
struct _RefFunClos<_Expr,_Dom> :
_FunBase<_Dom, const typename _Dom::value_type&>
_FunBase<_Dom, const typename _Dom::value_type&>
{
typedef _FunBase<_Dom, const typename _Dom::value_type&> _Base;
typedef typename _Base::value_type value_type;
typedef value_type _Tp;
_RefFunClos(const _Dom& __e, _Tp __f(const _Tp&))
: _Base(__e, __f) {}
};
template<typename _Tp>
struct _RefFunClos<_ValArray,_Tp> : _FunBase<valarray<_Tp>, const _Tp&>
struct _RefFunClos<_ValArray,_Tp> : _FunBase<valarray<_Tp>, const _Tp&>
{
typedef _FunBase<valarray<_Tp>, const _Tp&> _Base;
typedef _Tp value_type;
_RefFunClos(const valarray<_Tp>& __v, _Tp __f(const _Tp&))
: _Base(__v, __f) {}
};
//
// Unary expression closure.
//
@ -473,17 +473,17 @@ namespace std
typedef _Dom _Arg;
typedef _UnBase<_Oper, _Dom> _Base;
typedef typename _Base::value_type value_type;
_UnClos(const _Arg& __e) : _Base(__e) {}
};
template<class _Oper, typename _Tp>
struct _UnClos<_Oper, _ValArray, _Tp> : _UnBase<_Oper, valarray<_Tp> >
struct _UnClos<_Oper, _ValArray, _Tp> : _UnBase<_Oper, valarray<_Tp> >
{
typedef valarray<_Tp> _Arg;
typedef _UnBase<_Oper, valarray<_Tp> > _Base;
typedef typename _Base::value_type value_type;
_UnClos(const _Arg& __e) : _Base(__e) {}
};
@ -493,7 +493,7 @@ namespace std
//
template<class _Oper, class _FirstArg, class _SecondArg>
class _BinBase
class _BinBase
{
public:
typedef typename _FirstArg::value_type _Vt;
@ -501,12 +501,12 @@ namespace std
_BinBase(const _FirstArg& __e1, const _SecondArg& __e2)
: _M_expr1(__e1), _M_expr2(__e2) {}
value_type operator[](size_t __i) const
{ return _Oper()(_M_expr1[__i], _M_expr2[__i]); }
size_t size() const { return _M_expr1.size(); }
private:
const _FirstArg& _M_expr1;
const _SecondArg& _M_expr2;
@ -545,27 +545,27 @@ namespace std
value_type operator[](size_t __i) const
{ return _Oper()(_M_expr1, _M_expr2[__i]); }
size_t size() const { return _M_expr2.size(); }
private:
const _Vt& _M_expr1;
const _Clos& _M_expr2;
};
template<class _Oper, class _Dom1, class _Dom2>
struct _BinClos<_Oper, _Expr, _Expr, _Dom1, _Dom2>
: _BinBase<_Oper,_Dom1,_Dom2>
: _BinBase<_Oper,_Dom1,_Dom2>
{
typedef _BinBase<_Oper,_Dom1,_Dom2> _Base;
typedef typename _Base::value_type value_type;
_BinClos(const _Dom1& __e1, const _Dom2& __e2) : _Base(__e1, __e2) {}
};
template<class _Oper, typename _Tp>
struct _BinClos<_Oper,_ValArray,_ValArray,_Tp,_Tp>
: _BinBase<_Oper,valarray<_Tp>,valarray<_Tp> >
: _BinBase<_Oper,valarray<_Tp>,valarray<_Tp> >
{
typedef _BinBase<_Oper,valarray<_Tp>,valarray<_Tp> > _Base;
typedef _Tp value_type;
@ -576,70 +576,70 @@ namespace std
template<class _Oper, class _Dom>
struct _BinClos<_Oper,_Expr,_ValArray,_Dom,typename _Dom::value_type>
: _BinBase<_Oper,_Dom,valarray<typename _Dom::value_type> >
: _BinBase<_Oper,_Dom,valarray<typename _Dom::value_type> >
{
typedef typename _Dom::value_type _Tp;
typedef _BinBase<_Oper,_Dom,valarray<_Tp> > _Base;
typedef typename _Base::value_type value_type;
_BinClos(const _Dom& __e1, const valarray<_Tp>& __e2)
: _Base(__e1, __e2) {}
};
template<class _Oper, class _Dom>
struct _BinClos<_Oper,_ValArray,_Expr,typename _Dom::value_type,_Dom>
: _BinBase<_Oper,valarray<typename _Dom::value_type>,_Dom>
: _BinBase<_Oper,valarray<typename _Dom::value_type>,_Dom>
{
typedef typename _Dom::value_type _Tp;
typedef _BinBase<_Oper,valarray<_Tp>,_Dom> _Base;
typedef typename _Base::value_type value_type;
_BinClos(const valarray<_Tp>& __e1, const _Dom& __e2)
: _Base(__e1, __e2) {}
};
template<class _Oper, class _Dom>
struct _BinClos<_Oper,_Expr,_Constant,_Dom,typename _Dom::value_type>
: _BinBase2<_Oper,_Dom>
: _BinBase2<_Oper,_Dom>
{
typedef typename _Dom::value_type _Tp;
typedef _BinBase2<_Oper,_Dom> _Base;
typedef typename _Base::value_type value_type;
_BinClos(const _Dom& __e1, const _Tp& __e2) : _Base(__e1, __e2) {}
};
template<class _Oper, class _Dom>
struct _BinClos<_Oper,_Constant,_Expr,typename _Dom::value_type,_Dom>
: _BinBase1<_Oper,_Dom>
: _BinBase1<_Oper,_Dom>
{
typedef typename _Dom::value_type _Tp;
typedef _BinBase1<_Oper,_Dom> _Base;
typedef typename _Base::value_type value_type;
_BinClos(const _Tp& __e1, const _Dom& __e2) : _Base(__e1, __e2) {}
};
template<class _Oper, typename _Tp>
struct _BinClos<_Oper,_ValArray,_Constant,_Tp,_Tp>
: _BinBase2<_Oper,valarray<_Tp> >
: _BinBase2<_Oper,valarray<_Tp> >
{
typedef _BinBase2<_Oper,valarray<_Tp> > _Base;
typedef typename _Base::value_type value_type;
_BinClos(const valarray<_Tp>& __v, const _Tp& __t) : _Base(__v, __t) {}
};
template<class _Oper, typename _Tp>
struct _BinClos<_Oper,_Constant,_ValArray,_Tp,_Tp>
: _BinBase1<_Oper,valarray<_Tp> >
: _BinBase1<_Oper,valarray<_Tp> >
{
typedef _BinBase1<_Oper,valarray<_Tp> > _Base;
typedef typename _Base::value_type value_type;
_BinClos(const _Tp& __t, const valarray<_Tp>& __v) : _Base(__t, __v) {}
};
//
// slice_array closure.
@ -679,7 +679,7 @@ namespace std
template<class _Dom> struct _SClos<_Expr,_Dom> : _SBase<_Dom> {
typedef _SBase<_Dom> _Base;
typedef typename _Base::value_type value_type;
_SClos (const _Dom& __e, const slice& __s) : _Base (__e, __s) {}
};

View File

@ -84,7 +84,7 @@ namespace __gnu_norm
this->_M_end_of_storage = this->_M_start + __n;
}
}
template<typename _Tp, typename _Alloc>
typename vector<_Tp,_Alloc>::iterator
vector<_Tp,_Alloc>::
@ -100,7 +100,7 @@ namespace __gnu_norm
_M_insert_aux(__position, __x);
return begin() + __n;
}
template<typename _Tp, typename _Alloc>
typename vector<_Tp,_Alloc>::iterator
vector<_Tp,_Alloc>::
@ -112,7 +112,7 @@ namespace __gnu_norm
std::_Destroy(this->_M_finish);
return __position;
}
template<typename _Tp, typename _Alloc>
typename vector<_Tp,_Alloc>::iterator
vector<_Tp,_Alloc>::
@ -123,7 +123,7 @@ namespace __gnu_norm
this->_M_finish = this->_M_finish - (__last - __first);
return __first;
}
template<typename _Tp, typename _Alloc>
vector<_Tp,_Alloc>&
vector<_Tp,_Alloc>::
@ -155,7 +155,7 @@ namespace __gnu_norm
}
return *this;
}
template<typename _Tp, typename _Alloc>
void
vector<_Tp,_Alloc>::
@ -175,7 +175,7 @@ namespace __gnu_norm
else
erase(fill_n(begin(), __n, __val), end());
}
template<typename _Tp, typename _Alloc> template<typename _InputIterator>
void
vector<_Tp,_Alloc>::
@ -189,7 +189,7 @@ namespace __gnu_norm
else
insert(end(), __first, __last);
}
template<typename _Tp, typename _Alloc> template<typename _ForwardIterator>
void
vector<_Tp,_Alloc>::
@ -197,7 +197,7 @@ namespace __gnu_norm
forward_iterator_tag)
{
size_type __len = std::distance(__first, __last);
if (__len > capacity())
{
pointer __tmp(_M_allocate_and_copy(__len, __first, __last));
@ -221,7 +221,7 @@ namespace __gnu_norm
this->_M_finish = std::uninitialized_copy(__mid, __last, this->_M_finish);
}
}
template<typename _Tp, typename _Alloc>
void
vector<_Tp,_Alloc>::
@ -276,7 +276,7 @@ namespace __gnu_norm
{
if (__n != 0)
{
if (size_type(this->_M_end_of_storage - this->_M_finish) >= __n)
if (size_type(this->_M_end_of_storage - this->_M_finish) >= __n)
{
value_type __x_copy = __x;
const size_type __elems_after = end() - __position;
@ -312,7 +312,7 @@ namespace __gnu_norm
__new_finish = std::uninitialized_copy(begin(), __position,
__new_start);
__new_finish = std::uninitialized_fill_n(__new_finish, __n, __x);
__new_finish = std::uninitialized_copy(__position, end(),
__new_finish = std::uninitialized_copy(__position, end(),
__new_finish);
}
catch(...)
@ -330,7 +330,7 @@ namespace __gnu_norm
}
}
}
template<typename _Tp, typename _Alloc> template<typename _InputIterator>
void
vector<_Tp,_Alloc>::
@ -344,11 +344,11 @@ namespace __gnu_norm
++__pos;
}
}
template<typename _Tp, typename _Alloc> template<typename _ForwardIterator>
void
vector<_Tp,_Alloc>::
_M_range_insert(iterator __position,_ForwardIterator __first,
_M_range_insert(iterator __position,_ForwardIterator __first,
_ForwardIterator __last, forward_iterator_tag)
{
if (__first != __last)
@ -388,7 +388,7 @@ namespace __gnu_norm
{
__new_finish = std::uninitialized_copy(iterator(this->_M_start),
__position, __new_start);
__new_finish = std::uninitialized_copy(__first, __last,
__new_finish = std::uninitialized_copy(__first, __last,
__new_finish);
__new_finish = std::uninitialized_copy(__position,
iterator(this->_M_finish),