Commit ed6814f7 by Bernardo Innocenti Committed by Bernardo Innocenti

Remove trailing whitespace (see ChangeLog for longwinded description).

From-SVN: r77479
parent f276fb54
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> 2004-02-06 Paolo Carlini <pcarlini@suse.de>
* include/bits/basic_string.h: Fix comment. * include/bits/basic_string.h: Fix comment.
......
...@@ -84,7 +84,7 @@ namespace std ...@@ -84,7 +84,7 @@ namespace std
* (See @link Allocators allocators info @endlink for more.) * (See @link Allocators allocators info @endlink for more.)
*/ */
template<typename _Tp> template<typename _Tp>
class allocator: public __glibcxx_default_allocator<_Tp> class allocator: public __glibcxx_default_allocator<_Tp>
{ {
public: public:
typedef size_t size_type; typedef size_t size_type;
...@@ -101,7 +101,7 @@ namespace std ...@@ -101,7 +101,7 @@ namespace std
allocator() throw() { } allocator() throw() { }
allocator(const allocator& a) throw() allocator(const allocator& a) throw()
: __glibcxx_default_allocator<_Tp>(a) { } : __glibcxx_default_allocator<_Tp>(a) { }
template<typename _Tp1> template<typename _Tp1>
......
// Iostreams base classes -*- C++ -*- // Iostreams base classes -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003 // Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
#include <bits/locale_classes.h> #include <bits/locale_classes.h>
#include <bits/locale_facets.h> #include <bits/locale_facets.h>
namespace std namespace std
{ {
// 27.4.5 Template class basic_ios // 27.4.5 Template class basic_ios
/** /**
...@@ -76,12 +76,12 @@ namespace std ...@@ -76,12 +76,12 @@ namespace std
* @endif * @endif
*/ */
typedef ctype<_CharT> __ctype_type; typedef ctype<_CharT> __ctype_type;
typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> > typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> >
__num_put_type; __num_put_type;
typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> > typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
__num_get_type; __num_get_type;
//@} //@}
// Data members: // Data members:
protected: protected:
basic_ostream<_CharT, _Traits>* _M_tie; basic_ostream<_CharT, _Traits>* _M_tie;
...@@ -90,7 +90,7 @@ namespace std ...@@ -90,7 +90,7 @@ namespace std
basic_streambuf<_CharT, _Traits>* _M_streambuf; basic_streambuf<_CharT, _Traits>* _M_streambuf;
// Cached use_facet<ctype>, which is based on the current locale info. // Cached use_facet<ctype>, which is based on the current locale info.
const __ctype_type* _M_ctype; const __ctype_type* _M_ctype;
// For ostream. // For ostream.
const __num_put_type* _M_num_put; const __num_put_type* _M_num_put;
// For istream. // For istream.
...@@ -104,11 +104,11 @@ namespace std ...@@ -104,11 +104,11 @@ namespace std
* This allows you to write constructs such as * This allows you to write constructs such as
* "if (!a_stream) ..." and "while (a_stream) ..." * "if (!a_stream) ..." and "while (a_stream) ..."
*/ */
operator void*() const operator void*() const
{ return this->fail() ? 0 : const_cast<basic_ios*>(this); } { return this->fail() ? 0 : const_cast<basic_ios*>(this); }
bool bool
operator!() const operator!() const
{ return this->fail(); } { return this->fail(); }
//@} //@}
...@@ -119,8 +119,8 @@ namespace std ...@@ -119,8 +119,8 @@ namespace std
* See std::ios_base::iostate for the possible bit values. Most * See std::ios_base::iostate for the possible bit values. Most
* users will call one of the interpreting wrappers, e.g., good(). * users will call one of the interpreting wrappers, e.g., good().
*/ */
iostate iostate
rdstate() const rdstate() const
{ return _M_streambuf_state; } { return _M_streambuf_state; }
/** /**
...@@ -130,7 +130,7 @@ namespace std ...@@ -130,7 +130,7 @@ namespace std
* See std::ios_base::iostate for the possible bit values. Most * See std::ios_base::iostate for the possible bit values. Most
* users will not need to pass an argument. * users will not need to pass an argument.
*/ */
void void
clear(iostate __state = goodbit); clear(iostate __state = goodbit);
/** /**
...@@ -139,19 +139,19 @@ namespace std ...@@ -139,19 +139,19 @@ namespace std
* *
* See std::ios_base::iostate for the possible bit values. * See std::ios_base::iostate for the possible bit values.
*/ */
void void
setstate(iostate __state) setstate(iostate __state)
{ this->clear(this->rdstate() | __state); } { this->clear(this->rdstate() | __state); }
// Flip the internal state on for the proper state bits, then re // Flip the internal state on for the proper state bits, then re
// throws the propagated exception if bit also set in // throws the propagated exception if bit also set in
// exceptions(). // exceptions().
void void
_M_setstate(iostate __state) _M_setstate(iostate __state)
{ {
// 27.6.1.2.1 Common requirements. // 27.6.1.2.1 Common requirements.
// Turn this on without causing an ios::failure to be thrown. // Turn this on without causing an ios::failure to be thrown.
_M_streambuf_state |= __state; _M_streambuf_state |= __state;
if (this->exceptions() & __state) if (this->exceptions() & __state)
__throw_exception_again; __throw_exception_again;
} }
...@@ -162,8 +162,8 @@ namespace std ...@@ -162,8 +162,8 @@ namespace std
* *
* A wrapper around rdstate. * A wrapper around rdstate.
*/ */
bool bool
good() const good() const
{ return this->rdstate() == 0; } { return this->rdstate() == 0; }
/** /**
...@@ -172,8 +172,8 @@ namespace std ...@@ -172,8 +172,8 @@ namespace std
* *
* Note that other iostate flags may also be set. * Note that other iostate flags may also be set.
*/ */
bool bool
eof() const eof() const
{ return (this->rdstate() & eofbit) != 0; } { return (this->rdstate() & eofbit) != 0; }
/** /**
...@@ -183,8 +183,8 @@ namespace std ...@@ -183,8 +183,8 @@ namespace std
* Checking the badbit in fail() is historical practice. * Checking the badbit in fail() is historical practice.
* Note that other iostate flags may also be set. * Note that other iostate flags may also be set.
*/ */
bool bool
fail() const fail() const
{ return (this->rdstate() & (badbit | failbit)) != 0; } { return (this->rdstate() & (badbit | failbit)) != 0; }
/** /**
...@@ -193,8 +193,8 @@ namespace std ...@@ -193,8 +193,8 @@ namespace std
* *
* Note that other iostate flags may also be set. * Note that other iostate flags may also be set.
*/ */
bool bool
bad() const bad() const
{ return (this->rdstate() & badbit) != 0; } { return (this->rdstate() & badbit) != 0; }
/** /**
...@@ -204,8 +204,8 @@ namespace std ...@@ -204,8 +204,8 @@ namespace std
* This changes nothing in the stream. See the one-argument version * This changes nothing in the stream. See the one-argument version
* of exceptions(iostate) for the meaning of the return value. * of exceptions(iostate) for the meaning of the return value.
*/ */
iostate iostate
exceptions() const exceptions() const
{ return _M_exception; } { return _M_exception; }
/** /**
...@@ -224,26 +224,26 @@ namespace std ...@@ -224,26 +224,26 @@ namespace std
* #include <iostream> * #include <iostream>
* #include <fstream> * #include <fstream>
* #include <exception> * #include <exception>
* *
* int main() * int main()
* { * {
* std::set_terminate (__gnu_cxx::__verbose_terminate_handler); * std::set_terminate (__gnu_cxx::__verbose_terminate_handler);
* *
* std::ifstream f ("/etc/motd"); * std::ifstream f ("/etc/motd");
* *
* std::cerr << "Setting badbit\n"; * std::cerr << "Setting badbit\n";
* f.setstate (std::ios_base::badbit); * f.setstate (std::ios_base::badbit);
* *
* std::cerr << "Setting exception mask\n"; * std::cerr << "Setting exception mask\n";
* f.exceptions (std::ios_base::badbit); * f.exceptions (std::ios_base::badbit);
* } * }
* @endcode * @endcode
*/ */
void void
exceptions(iostate __except) exceptions(iostate __except)
{ {
_M_exception = __except; _M_exception = __except;
this->clear(_M_streambuf_state); this->clear(_M_streambuf_state);
} }
// Constructor/destructor: // Constructor/destructor:
...@@ -252,8 +252,8 @@ namespace std ...@@ -252,8 +252,8 @@ namespace std
* *
* The parameter is passed by derived streams. * The parameter is passed by derived streams.
*/ */
explicit explicit
basic_ios(basic_streambuf<_CharT, _Traits>* __sb) basic_ios(basic_streambuf<_CharT, _Traits>* __sb)
: ios_base(), _M_ctype(0), _M_num_put(0), _M_num_get(0) : ios_base(), _M_ctype(0), _M_num_put(0), _M_num_get(0)
{ this->init(__sb); } { this->init(__sb); }
...@@ -263,9 +263,9 @@ namespace std ...@@ -263,9 +263,9 @@ namespace std
* The destructor does nothing. More specifically, it does not * The destructor does nothing. More specifically, it does not
* destroy the streambuf held by rdbuf(). * destroy the streambuf held by rdbuf().
*/ */
virtual virtual
~basic_ios() { } ~basic_ios() { }
// Members: // Members:
/** /**
* @brief Fetches the current @e tied stream. * @brief Fetches the current @e tied stream.
...@@ -277,7 +277,7 @@ namespace std ...@@ -277,7 +277,7 @@ namespace std
* first flushed. For example, @c std::cin is tied to @c std::cout. * first flushed. For example, @c std::cin is tied to @c std::cout.
*/ */
basic_ostream<_CharT, _Traits>* basic_ostream<_CharT, _Traits>*
tie() const tie() const
{ return _M_tie; } { return _M_tie; }
/** /**
...@@ -303,7 +303,7 @@ namespace std ...@@ -303,7 +303,7 @@ namespace std
* This does not change the state of the stream. * This does not change the state of the stream.
*/ */
basic_streambuf<_CharT, _Traits>* basic_streambuf<_CharT, _Traits>*
rdbuf() const rdbuf() const
{ return _M_streambuf; } { return _M_streambuf; }
/** /**
...@@ -328,7 +328,7 @@ namespace std ...@@ -328,7 +328,7 @@ namespace std
* foo.ios::rdbuf(p); // ios == basic_ios<char> * foo.ios::rdbuf(p); // ios == basic_ios<char>
* @endcode * @endcode
*/ */
basic_streambuf<_CharT, _Traits>* basic_streambuf<_CharT, _Traits>*
rdbuf(basic_streambuf<_CharT, _Traits>* __sb); rdbuf(basic_streambuf<_CharT, _Traits>* __sb);
/** /**
...@@ -351,15 +351,15 @@ namespace std ...@@ -351,15 +351,15 @@ namespace std
* *
* It defaults to a space (' ') in the current locale. * It defaults to a space (' ') in the current locale.
*/ */
char_type char_type
fill() const fill() const
{ {
if (!_M_fill_init) if (!_M_fill_init)
{ {
_M_fill = this->widen(' '); _M_fill = this->widen(' ');
_M_fill_init = true; _M_fill_init = true;
} }
return _M_fill; return _M_fill;
} }
/** /**
...@@ -371,7 +371,7 @@ namespace std ...@@ -371,7 +371,7 @@ namespace std
* have been requested (e.g., via setw), Q characters are actually * have been requested (e.g., via setw), Q characters are actually
* used, and Q<P. It defaults to a space (' ') in the current locale. * used, and Q<P. It defaults to a space (' ') in the current locale.
*/ */
char_type char_type
fill(char_type __ch) fill(char_type __ch)
{ {
char_type __old = this->fill(); char_type __old = this->fill();
...@@ -391,7 +391,7 @@ namespace std ...@@ -391,7 +391,7 @@ namespace std
* Additional l10n notes are at * Additional l10n notes are at
* http://gcc.gnu.org/onlinedocs/libstdc++/22_locale/howto.html * http://gcc.gnu.org/onlinedocs/libstdc++/22_locale/howto.html
*/ */
locale locale
imbue(const locale& __loc); imbue(const locale& __loc);
/** /**
...@@ -411,7 +411,7 @@ namespace std ...@@ -411,7 +411,7 @@ namespace std
* Additional l10n notes are at * Additional l10n notes are at
* http://gcc.gnu.org/onlinedocs/libstdc++/22_locale/howto.html * http://gcc.gnu.org/onlinedocs/libstdc++/22_locale/howto.html
*/ */
char char
narrow(char_type __c, char __dfault) const; narrow(char_type __c, char __dfault) const;
/** /**
...@@ -429,9 +429,9 @@ namespace std ...@@ -429,9 +429,9 @@ namespace std
* Additional l10n notes are at * Additional l10n notes are at
* http://gcc.gnu.org/onlinedocs/libstdc++/22_locale/howto.html * http://gcc.gnu.org/onlinedocs/libstdc++/22_locale/howto.html
*/ */
char_type char_type
widen(char __c) const; widen(char __c) const;
protected: protected:
// 27.4.5.1 basic_ios constructors // 27.4.5.1 basic_ios constructors
/** /**
...@@ -449,7 +449,7 @@ namespace std ...@@ -449,7 +449,7 @@ namespace std
* This is called from the public constructor. It is not virtual and * This is called from the public constructor. It is not virtual and
* cannot be redefined. * cannot be redefined.
*/ */
void void
init(basic_streambuf<_CharT, _Traits>* __sb); init(basic_streambuf<_CharT, _Traits>* __sb);
void void
......
...@@ -37,7 +37,7 @@ namespace std ...@@ -37,7 +37,7 @@ namespace std
template<typename _CharT, typename _Traits> template<typename _CharT, typename _Traits>
void void
basic_ios<_CharT, _Traits>::clear(iostate __state) basic_ios<_CharT, _Traits>::clear(iostate __state)
{ {
if (this->rdbuf()) if (this->rdbuf())
_M_streambuf_state = __state; _M_streambuf_state = __state;
else else
...@@ -45,9 +45,9 @@ namespace std ...@@ -45,9 +45,9 @@ namespace std
if (this->exceptions() & this->rdstate()) if (this->exceptions() & this->rdstate())
__throw_ios_failure(__N("basic_ios::clear")); __throw_ios_failure(__N("basic_ios::clear"));
} }
template<typename _CharT, typename _Traits> template<typename _CharT, typename _Traits>
basic_streambuf<_CharT, _Traits>* basic_streambuf<_CharT, _Traits>*
basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<_CharT, _Traits>* __sb) basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<_CharT, _Traits>* __sb)
{ {
basic_streambuf<_CharT, _Traits>* __old = _M_streambuf; basic_streambuf<_CharT, _Traits>* __old = _M_streambuf;
...@@ -66,17 +66,17 @@ namespace std ...@@ -66,17 +66,17 @@ namespace std
{ {
// Per 27.1.1, do not call imbue, yet must trash all caches // Per 27.1.1, do not call imbue, yet must trash all caches
// associated with imbue() // associated with imbue()
// Alloc any new word array first, so if it fails we have "rollback". // Alloc any new word array first, so if it fails we have "rollback".
_Words* __words = (__rhs._M_word_size <= _S_local_word_size) ? _Words* __words = (__rhs._M_word_size <= _S_local_word_size) ?
_M_local_word : new _Words[__rhs._M_word_size]; _M_local_word : new _Words[__rhs._M_word_size];
// Bump refs before doing callbacks, for safety. // Bump refs before doing callbacks, for safety.
_Callback_list* __cb = __rhs._M_callbacks; _Callback_list* __cb = __rhs._M_callbacks;
if (__cb) if (__cb)
__cb->_M_add_reference(); __cb->_M_add_reference();
_M_call_callbacks(erase_event); _M_call_callbacks(erase_event);
if (_M_word != _M_local_word) if (_M_word != _M_local_word)
{ {
delete [] _M_word; delete [] _M_word;
_M_word = 0; _M_word = 0;
...@@ -84,17 +84,17 @@ namespace std ...@@ -84,17 +84,17 @@ namespace std
_M_dispose_callbacks(); _M_dispose_callbacks();
// NB: Don't want any added during above. // NB: Don't want any added during above.
_M_callbacks = __cb; _M_callbacks = __cb;
for (int __i = 0; __i < __rhs._M_word_size; ++__i) for (int __i = 0; __i < __rhs._M_word_size; ++__i)
__words[__i] = __rhs._M_word[__i]; __words[__i] = __rhs._M_word[__i];
if (_M_word != _M_local_word) if (_M_word != _M_local_word)
{ {
delete [] _M_word; delete [] _M_word;
_M_word = 0; _M_word = 0;
} }
_M_word = __words; _M_word = __words;
_M_word_size = __rhs._M_word_size; _M_word_size = __rhs._M_word_size;
this->flags(__rhs.flags()); this->flags(__rhs.flags());
this->width(__rhs.width()); this->width(__rhs.width());
this->precision(__rhs.precision()); this->precision(__rhs.precision());
...@@ -102,9 +102,9 @@ namespace std ...@@ -102,9 +102,9 @@ namespace std
this->fill(__rhs.fill()); this->fill(__rhs.fill());
_M_ios_locale = __rhs.getloc(); _M_ios_locale = __rhs.getloc();
_M_cache_locale(_M_ios_locale); _M_cache_locale(_M_ios_locale);
_M_call_callbacks(copyfmt_event); _M_call_callbacks(copyfmt_event);
// The next is required to be the last assignment. // The next is required to be the last assignment.
this->exceptions(__rhs.exceptions()); this->exceptions(__rhs.exceptions());
} }
...@@ -172,13 +172,13 @@ namespace std ...@@ -172,13 +172,13 @@ namespace std
if (__builtin_expect(has_facet<__ctype_type>(__loc), true)) if (__builtin_expect(has_facet<__ctype_type>(__loc), true))
_M_ctype = &use_facet<__ctype_type>(__loc); _M_ctype = &use_facet<__ctype_type>(__loc);
if (__builtin_expect(has_facet<__num_put_type>(__loc), true)) 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)) 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, // 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. // NB: This syntax is a GNU extension.
#if _GLIBCXX_EXTERN_TEMPLATE #if _GLIBCXX_EXTERN_TEMPLATE
extern template class basic_ios<char>; extern template class basic_ios<char>;
...@@ -189,4 +189,4 @@ namespace std ...@@ -189,4 +189,4 @@ namespace std
#endif #endif
} // namespace std } // namespace std
#endif #endif
...@@ -87,7 +87,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; ...@@ -87,7 +87,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
template <class _Tp> template <class _Tp>
struct _IntegerConcept { struct _IntegerConcept {
void __constraints() { void __constraints() {
this->__error_type_must_be_an_integer_type(); this->__error_type_must_be_an_integer_type();
} }
}; };
...@@ -103,7 +103,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; ...@@ -103,7 +103,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
template <class _Tp> template <class _Tp>
struct _SignedIntegerConcept { struct _SignedIntegerConcept {
void __constraints() { void __constraints() {
this->__error_type_must_be_a_signed_integer_type(); this->__error_type_must_be_a_signed_integer_type();
} }
}; };
...@@ -114,7 +114,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; ...@@ -114,7 +114,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
template <class _Tp> template <class _Tp>
struct _UnsignedIntegerConcept { struct _UnsignedIntegerConcept {
void __constraints() { void __constraints() {
this->__error_type_must_be_an_unsigned_integer_type(); this->__error_type_must_be_an_unsigned_integer_type();
} }
}; };
...@@ -312,7 +312,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; ...@@ -312,7 +312,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
template <class _Func, class _Arg> template <class _Func, class _Arg>
struct _UnaryFunctionConcept<_Func, void, _Arg> { struct _UnaryFunctionConcept<_Func, void, _Arg> {
void __constraints() { void __constraints() {
__f(__arg); // require operator() __f(__arg); // require operator()
} }
_Func __f; _Func __f;
...@@ -322,7 +322,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; ...@@ -322,7 +322,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
template <class _Func, class _Return, class _First, class _Second> template <class _Func, class _Return, class _First, class _Second>
struct _BinaryFunctionConcept struct _BinaryFunctionConcept
{ {
void __constraints() { void __constraints() {
__r = __f(__first, __second); // require operator() __r = __f(__first, __second); // require operator()
} }
_Func __f; _Func __f;
...@@ -366,7 +366,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; ...@@ -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 // use this when functor is used inside a container class like std::set
template <class _Func, class _First, class _Second> template <class _Func, class _First, class _Second>
struct _Const_BinaryPredicateConcept { struct _Const_BinaryPredicateConcept {
void __constraints() { void __constraints() {
__const_constraints(__f); __const_constraints(__f);
} }
void __const_constraints(const _Func& __fun) { void __const_constraints(const _Func& __fun) {
...@@ -560,7 +560,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; ...@@ -560,7 +560,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
typedef typename _Container::reference _Reference; typedef typename _Container::reference _Reference;
typedef typename _Container::iterator _Iterator; typedef typename _Container::iterator _Iterator;
typedef typename _Container::pointer _Pointer; typedef typename _Container::pointer _Pointer;
void __constraints() { void __constraints() {
__function_requires< _ContainerConcept<_Container> >(); __function_requires< _ContainerConcept<_Container> >();
__function_requires< _AssignableConcept<_Value_type> >(); __function_requires< _AssignableConcept<_Value_type> >();
...@@ -582,7 +582,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; ...@@ -582,7 +582,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
typedef typename _ForwardContainer::const_iterator _Const_iterator; typedef typename _ForwardContainer::const_iterator _Const_iterator;
__function_requires< _ForwardIteratorConcept<_Const_iterator> >(); __function_requires< _ForwardIteratorConcept<_Const_iterator> >();
} }
}; };
template <class _ForwardContainer> template <class _ForwardContainer>
struct _Mutable_ForwardContainerConcept struct _Mutable_ForwardContainerConcept
...@@ -593,7 +593,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; ...@@ -593,7 +593,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
typedef typename _ForwardContainer::iterator _Iterator; typedef typename _ForwardContainer::iterator _Iterator;
__function_requires< _Mutable_ForwardIteratorConcept<_Iterator> >(); __function_requires< _Mutable_ForwardIteratorConcept<_Iterator> >();
} }
}; };
template <class _ReversibleContainer> template <class _ReversibleContainer>
struct _ReversibleContainerConcept struct _ReversibleContainerConcept
...@@ -693,7 +693,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; ...@@ -693,7 +693,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
__function_requires< _Mutable_ForwardContainerConcept<_Sequence> >(); __function_requires< _Mutable_ForwardContainerConcept<_Sequence> >();
__function_requires< _DefaultConstructibleConcept<_Sequence> >(); __function_requires< _DefaultConstructibleConcept<_Sequence> >();
_Sequence _Sequence
__c(__n) _IsUnused, __c(__n) _IsUnused,
__c2(__n, __t) _IsUnused, __c2(__n, __t) _IsUnused,
__c3(__first, __last) _IsUnused; __c3(__first, __last) _IsUnused;
...@@ -758,7 +758,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; ...@@ -758,7 +758,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
__function_requires< _ForwardContainerConcept<_AssociativeContainer> >(); __function_requires< _ForwardContainerConcept<_AssociativeContainer> >();
__function_requires< __function_requires<
_DefaultConstructibleConcept<_AssociativeContainer> >(); _DefaultConstructibleConcept<_AssociativeContainer> >();
__i = __c.find(__k); __i = __c.find(__k);
__r = __c.equal_range(__k); __r = __c.equal_range(__k);
__c.erase(__k); __c.erase(__k);
...@@ -789,9 +789,9 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; ...@@ -789,9 +789,9 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
void __constraints() { void __constraints() {
__function_requires< __function_requires<
_AssociativeContainerConcept<_UniqueAssociativeContainer> >(); _AssociativeContainerConcept<_UniqueAssociativeContainer> >();
_UniqueAssociativeContainer __c(__first, __last); _UniqueAssociativeContainer __c(__first, __last);
__pos_flag = __c.insert(__t); __pos_flag = __c.insert(__t);
__c.insert(__first, __last); __c.insert(__first, __last);
} }
...@@ -808,7 +808,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; ...@@ -808,7 +808,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
_AssociativeContainerConcept<_MultipleAssociativeContainer> >(); _AssociativeContainerConcept<_MultipleAssociativeContainer> >();
_MultipleAssociativeContainer __c(__first, __last); _MultipleAssociativeContainer __c(__first, __last);
__pos = __c.insert(__t); __pos = __c.insert(__t);
__c.insert(__first, __last); __c.insert(__first, __last);
...@@ -855,7 +855,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; ...@@ -855,7 +855,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
__function_requires< __function_requires<
_ReversibleContainerConcept<_SortedAssociativeContainer> >(); _ReversibleContainerConcept<_SortedAssociativeContainer> >();
_SortedAssociativeContainer _SortedAssociativeContainer
__c(__kc) _IsUnused, __c(__kc) _IsUnused,
__c2(__first, __last) _IsUnused, __c2(__first, __last) _IsUnused,
__c3(__first, __last, __kc) _IsUnused; __c3(__first, __last, __kc) _IsUnused;
...@@ -863,7 +863,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; ...@@ -863,7 +863,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
__p = __c.upper_bound(__k); __p = __c.upper_bound(__k);
__p = __c.lower_bound(__k); __p = __c.lower_bound(__k);
__r = __c.equal_range(__k); __r = __c.equal_range(__k);
__c.insert(__p, __t); __c.insert(__p, __t);
} }
void __const_constraints(const _SortedAssociativeContainer& __c) { void __const_constraints(const _SortedAssociativeContainer& __c) {
......
...@@ -50,12 +50,12 @@ namespace __gnu_cxx ...@@ -50,12 +50,12 @@ namespace __gnu_cxx
{ {
/** /**
* @brief Mapping from character type to associated types. * @brief Mapping from character type to associated types.
* *
* *
* @note This is an implementation class for the generic version * @note This is an implementation class for the generic version
* of char_traits. It defines int_type, off_type, pos_type, and * of char_traits. It defines int_type, off_type, pos_type, and
* state_type. By default these are unsigned long, streamoff, * 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 * types, but who don't need to change the definitions of any function
* defined in char_traits, can specialize __gnu_cxx::_Char_types * defined in char_traits, can specialize __gnu_cxx::_Char_types
* while leaving __gnu_cxx::char_traits alone. */ * while leaving __gnu_cxx::char_traits alone. */
...@@ -91,54 +91,54 @@ namespace __gnu_cxx ...@@ -91,54 +91,54 @@ namespace __gnu_cxx
typedef typename _Char_types<_CharT>::pos_type pos_type; typedef typename _Char_types<_CharT>::pos_type pos_type;
typedef typename _Char_types<_CharT>::off_type off_type; typedef typename _Char_types<_CharT>::off_type off_type;
typedef typename _Char_types<_CharT>::state_type state_type; typedef typename _Char_types<_CharT>::state_type state_type;
static void static void
assign(char_type& __c1, const char_type& __c2) assign(char_type& __c1, const char_type& __c2)
{ __c1 = __c2; } { __c1 = __c2; }
static bool static bool
eq(const char_type& __c1, const char_type& __c2) eq(const char_type& __c1, const char_type& __c2)
{ return __c1 == __c2; } { return __c1 == __c2; }
static bool static bool
lt(const char_type& __c1, const char_type& __c2) lt(const char_type& __c1, const char_type& __c2)
{ return __c1 < __c2; } { return __c1 < __c2; }
static int static int
compare(const char_type* __s1, const char_type* __s2, std::size_t __n); compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
static std::size_t static std::size_t
length(const char_type* __s); 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); 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); 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); 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); assign(char_type* __s, std::size_t __n, char_type __a);
static char_type static char_type
to_char_type(const int_type& __c) to_char_type(const int_type& __c)
{ return static_cast<char_type>(__c); } { return static_cast<char_type>(__c); }
static int_type static int_type
to_int_type(const char_type& __c) to_int_type(const char_type& __c)
{ return static_cast<int_type>(__c); } { return static_cast<int_type>(__c); }
static bool static bool
eq_int_type(const int_type& __c1, const int_type& __c2) eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; } { return __c1 == __c2; }
static int_type static int_type
eof() eof()
{ return static_cast<int_type>(EOF); } { return static_cast<int_type>(EOF); }
static int_type static int_type
not_eof(const int_type& __c) not_eof(const int_type& __c)
{ return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); } { return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); }
}; };
...@@ -168,7 +168,7 @@ namespace __gnu_cxx ...@@ -168,7 +168,7 @@ namespace __gnu_cxx
} }
template<typename _CharT> template<typename _CharT>
const typename char_traits<_CharT>::char_type* const typename char_traits<_CharT>::char_type*
char_traits<_CharT>:: char_traits<_CharT>::
find(const char_type* __s, std::size_t __n, const char_type& __a) find(const char_type* __s, std::size_t __n, const char_type& __a)
{ {
...@@ -188,7 +188,7 @@ namespace __gnu_cxx ...@@ -188,7 +188,7 @@ namespace __gnu_cxx
} }
template<typename _CharT> template<typename _CharT>
typename char_traits<_CharT>::char_type* typename char_traits<_CharT>::char_type*
char_traits<_CharT>:: char_traits<_CharT>::
copy(char_type* __s1, const char_type* __s2, std::size_t __n) copy(char_type* __s1, const char_type* __s2, std::size_t __n)
{ {
...@@ -197,7 +197,7 @@ namespace __gnu_cxx ...@@ -197,7 +197,7 @@ namespace __gnu_cxx
} }
template<typename _CharT> template<typename _CharT>
typename char_traits<_CharT>::char_type* typename char_traits<_CharT>::char_type*
char_traits<_CharT>:: char_traits<_CharT>::
assign(char_type* __s, std::size_t __n, char_type __a) assign(char_type* __s, std::size_t __n, char_type __a)
{ {
...@@ -206,7 +206,7 @@ namespace __gnu_cxx ...@@ -206,7 +206,7 @@ namespace __gnu_cxx
} }
} }
namespace std namespace std
{ {
// 21.1 // 21.1
/** /**
...@@ -237,19 +237,19 @@ namespace std ...@@ -237,19 +237,19 @@ namespace std
typedef streamoff off_type; typedef streamoff off_type;
typedef mbstate_t state_type; typedef mbstate_t state_type;
static void static void
assign(char_type& __c1, const char_type& __c2) assign(char_type& __c1, const char_type& __c2)
{ __c1 = __c2; } { __c1 = __c2; }
static bool static bool
eq(const char_type& __c1, const char_type& __c2) eq(const char_type& __c1, const char_type& __c2)
{ return __c1 == __c2; } { return __c1 == __c2; }
static bool static bool
lt(const char_type& __c1, const char_type& __c2) lt(const char_type& __c1, const char_type& __c2)
{ return __c1 < __c2; } { return __c1 < __c2; }
static int static int
compare(const char_type* __s1, const char_type* __s2, size_t __n) compare(const char_type* __s1, const char_type* __s2, size_t __n)
{ return memcmp(__s1, __s2, __n); } { return memcmp(__s1, __s2, __n); }
...@@ -257,40 +257,40 @@ namespace std ...@@ -257,40 +257,40 @@ namespace std
length(const char_type* __s) length(const char_type* __s)
{ return strlen(__s); } { return strlen(__s); }
static const char_type* static const char_type*
find(const char_type* __s, size_t __n, const char_type& __a) find(const char_type* __s, size_t __n, const char_type& __a)
{ return static_cast<const char_type*>(memchr(__s, __a, __n)); } { 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) move(char_type* __s1, const char_type* __s2, size_t __n)
{ return static_cast<char_type*>(memmove(__s1, __s2, __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) copy(char_type* __s1, const char_type* __s2, size_t __n)
{ return static_cast<char_type*>(memcpy(__s1, __s2, __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) assign(char_type* __s, size_t __n, char_type __a)
{ return static_cast<char_type*>(memset(__s, __a, __n)); } { return static_cast<char_type*>(memset(__s, __a, __n)); }
static char_type static char_type
to_char_type(const int_type& __c) to_char_type(const int_type& __c)
{ return static_cast<char_type>(__c); } { return static_cast<char_type>(__c); }
// To keep both the byte 0xff and the eof symbol 0xffffffff // To keep both the byte 0xff and the eof symbol 0xffffffff
// from ending up as 0xffffffff. // from ending up as 0xffffffff.
static int_type static int_type
to_int_type(const char_type& __c) to_int_type(const char_type& __c)
{ return static_cast<int_type>(static_cast<unsigned char>(__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) eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; } { return __c1 == __c2; }
static int_type static int_type
eof() { return static_cast<int_type>(EOF); } eof() { return static_cast<int_type>(EOF); }
static int_type static int_type
not_eof(const int_type& __c) not_eof(const int_type& __c)
{ return (__c == eof()) ? 0 : __c; } { return (__c == eof()) ? 0 : __c; }
}; };
...@@ -306,20 +306,20 @@ namespace std ...@@ -306,20 +306,20 @@ namespace std
typedef streamoff off_type; typedef streamoff off_type;
typedef wstreampos pos_type; typedef wstreampos pos_type;
typedef mbstate_t state_type; typedef mbstate_t state_type;
static void static void
assign(char_type& __c1, const char_type& __c2) assign(char_type& __c1, const char_type& __c2)
{ __c1 = __c2; } { __c1 = __c2; }
static bool static bool
eq(const char_type& __c1, const char_type& __c2) eq(const char_type& __c1, const char_type& __c2)
{ return __c1 == __c2; } { return __c1 == __c2; }
static bool static bool
lt(const char_type& __c1, const char_type& __c2) lt(const char_type& __c1, const char_type& __c2)
{ return __c1 < __c2; } { return __c1 < __c2; }
static int static int
compare(const char_type* __s1, const char_type* __s2, size_t __n) compare(const char_type* __s1, const char_type* __s2, size_t __n)
{ return wmemcmp(__s1, __s2, __n); } { return wmemcmp(__s1, __s2, __n); }
...@@ -327,36 +327,36 @@ namespace std ...@@ -327,36 +327,36 @@ namespace std
length(const char_type* __s) length(const char_type* __s)
{ return wcslen(__s); } { return wcslen(__s); }
static const char_type* static const char_type*
find(const char_type* __s, size_t __n, const char_type& __a) find(const char_type* __s, size_t __n, const char_type& __a)
{ return wmemchr(__s, __a, __n); } { return wmemchr(__s, __a, __n); }
static char_type* static char_type*
move(char_type* __s1, const char_type* __s2, size_t __n) move(char_type* __s1, const char_type* __s2, size_t __n)
{ return wmemmove(__s1, __s2, __n); } { return wmemmove(__s1, __s2, __n); }
static char_type* static char_type*
copy(char_type* __s1, const char_type* __s2, size_t __n) copy(char_type* __s1, const char_type* __s2, size_t __n)
{ return wmemcpy(__s1, __s2, __n); } { return wmemcpy(__s1, __s2, __n); }
static char_type* static char_type*
assign(char_type* __s, size_t __n, char_type __a) assign(char_type* __s, size_t __n, char_type __a)
{ return wmemset(__s, __a, __n); } { return wmemset(__s, __a, __n); }
static char_type static char_type
to_char_type(const int_type& __c) { return char_type(__c); } 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); } 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) eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; } { return __c1 == __c2; }
static int_type static int_type
eof() { return static_cast<int_type>(WEOF); } eof() { return static_cast<int_type>(WEOF); }
static int_type static int_type
not_eof(const int_type& __c) not_eof(const int_type& __c)
{ return eq_int_type(__c, eof()) ? 0 : __c; } { return eq_int_type(__c, eof()) ? 0 : __c; }
}; };
...@@ -368,7 +368,7 @@ namespace std ...@@ -368,7 +368,7 @@ namespace std
_CharT _M_c; _CharT _M_c;
_Char_traits_match(_CharT const& __c) : _M_c(__c) { } _Char_traits_match(_CharT const& __c) : _M_c(__c) { }
bool bool
operator()(_CharT const& __a) { return _Traits::eq(_M_c, __a); } operator()(_CharT const& __a) { return _Traits::eq(_M_c, __a); }
}; };
} // namespace std } // namespace std
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
// the GNU General Public License. This exception does not however // the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by // invalidate any other reasons why the executable file might be covered by
// the GNU General Public License. // the GNU General Public License.
#ifndef _CONCURRENCE #ifndef _CONCURRENCE
#define _CONCURRENCE 1 #define _CONCURRENCE 1
...@@ -47,8 +47,8 @@ __GTHREAD_MUTEX_INIT_FUNCTION(&NAME) ...@@ -47,8 +47,8 @@ __GTHREAD_MUTEX_INIT_FUNCTION(&NAME)
# define __glibcxx_mutex_unlock(LOCK) __gthread_mutex_unlock(&LOCK) # define __glibcxx_mutex_unlock(LOCK) __gthread_mutex_unlock(&LOCK)
#else #else
# define __glibcxx_mutex_define_initialized(NAME) # define __glibcxx_mutex_define_initialized(NAME)
# define __glibcxx_mutex_lock(LOCK) # define __glibcxx_mutex_lock(LOCK)
# define __glibcxx_mutex_unlock(LOCK) # define __glibcxx_mutex_unlock(LOCK)
#endif #endif
#endif #endif
...@@ -139,7 +139,7 @@ namespace std ...@@ -139,7 +139,7 @@ namespace std
_M_type = 1 _M_type = 1
}; };
}; };
template<> template<>
struct __is_integer<char> struct __is_integer<char>
{ {
...@@ -157,7 +157,7 @@ namespace std ...@@ -157,7 +157,7 @@ namespace std
_M_type = 1 _M_type = 1
}; };
}; };
template<> template<>
struct __is_integer<unsigned char> struct __is_integer<unsigned char>
{ {
...@@ -177,7 +177,7 @@ namespace std ...@@ -177,7 +177,7 @@ namespace std
}; };
}; };
# endif # endif
template<> template<>
struct __is_integer<short> struct __is_integer<short>
{ {
......
...@@ -35,22 +35,22 @@ ...@@ -35,22 +35,22 @@
namespace std namespace std
{ {
// Helper for exception objects in <except> // Helper for exception objects in <except>
void void
__throw_bad_exception(void); __throw_bad_exception(void);
// Helper for exception objects in <new> // Helper for exception objects in <new>
void void
__throw_bad_alloc(void); __throw_bad_alloc(void);
// Helper for exception objects in <typeinfo> // Helper for exception objects in <typeinfo>
void void
__throw_bad_cast(void); __throw_bad_cast(void);
void void
__throw_bad_typeid(void); __throw_bad_typeid(void);
// Helpers for exception objects in <stdexcept> // Helpers for exception objects in <stdexcept>
void void
__throw_logic_error(const char* __s); __throw_logic_error(const char* __s);
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#pragma GCC system_header #pragma GCC system_header
namespace std { namespace std {
/** /**
* @brief Class defining multi-dimensional subset of an array. * @brief Class defining multi-dimensional subset of an array.
* *
...@@ -90,7 +90,7 @@ namespace std { ...@@ -90,7 +90,7 @@ namespace std {
// XXX: See the note above. // XXX: See the note above.
/// Assignment operator. /// Assignment operator.
gslice& operator=(const gslice&); gslice& operator=(const gslice&);
/// Return array offset of first slice element. /// Return array offset of first slice element.
size_t start() const; size_t start() const;
...@@ -99,7 +99,7 @@ namespace std { ...@@ -99,7 +99,7 @@ namespace std {
/// Return array of array strides for each dimension. /// Return array of array strides for each dimension.
valarray<size_t> stride() const; valarray<size_t> stride() const;
private: private:
struct _Indexer { struct _Indexer {
size_t _M_count; size_t _M_count;
...@@ -114,22 +114,22 @@ namespace std { ...@@ -114,22 +114,22 @@ namespace std {
}; };
_Indexer* _M_index; _Indexer* _M_index;
template<typename _Tp> friend class valarray; template<typename _Tp> friend class valarray;
}; };
inline size_t inline size_t
gslice::start () const gslice::start () const
{ return _M_index ? _M_index->_M_start : 0; } { return _M_index ? _M_index->_M_start : 0; }
inline valarray<size_t> inline valarray<size_t>
gslice::size () const gslice::size () const
{ return _M_index ? _M_index->_M_size : valarray<size_t>(); } { return _M_index ? _M_index->_M_size : valarray<size_t>(); }
inline valarray<size_t> inline valarray<size_t>
gslice::stride () const gslice::stride () const
{ return _M_index ? _M_index->_M_stride : valarray<size_t>(); } { return _M_index ? _M_index->_M_stride : valarray<size_t>(); }
inline gslice::gslice () : _M_index(0) {} inline gslice::gslice () : _M_index(0) {}
inline inline
...@@ -140,7 +140,7 @@ namespace std { ...@@ -140,7 +140,7 @@ namespace std {
inline inline
gslice::gslice(const gslice& __g) : _M_index(__g._M_index) gslice::gslice(const gslice& __g) : _M_index(__g._M_index)
{ if (_M_index) _M_index->_M_increment_use(); } { if (_M_index) _M_index->_M_increment_use(); }
inline inline
gslice::~gslice() gslice::~gslice()
{ if (_M_index && _M_index->_M_decrement_use() == 0) delete _M_index; } { if (_M_index && _M_index->_M_decrement_use() == 0) delete _M_index; }
...@@ -153,8 +153,8 @@ namespace std { ...@@ -153,8 +153,8 @@ namespace std {
_M_index = __g._M_index; _M_index = __g._M_index;
return *this; return *this;
} }
} // std:: } // std::
......
...@@ -108,13 +108,13 @@ namespace std { ...@@ -108,13 +108,13 @@ namespace std {
void operator<<=(const _Expr<_Dom,_Tp>&) const; void operator<<=(const _Expr<_Dom,_Tp>&) const;
template<class _Dom> template<class _Dom>
void operator>>=(const _Expr<_Dom,_Tp>&) const; void operator>>=(const _Expr<_Dom,_Tp>&) const;
private: private:
_Array<_Tp> _M_array; _Array<_Tp> _M_array;
const valarray<size_t>& _M_index; const valarray<size_t>& _M_index;
friend class valarray<_Tp>; friend class valarray<_Tp>;
gslice_array(_Array<_Tp>, const valarray<size_t>&); gslice_array(_Array<_Tp>, const valarray<size_t>&);
// this constructor needs to be implemented. // this constructor needs to be implemented.
...@@ -141,13 +141,13 @@ namespace std { ...@@ -141,13 +141,13 @@ namespace std {
gslice_array<_Tp>::gslice_array(const gslice_array<_Tp>& __a) gslice_array<_Tp>::gslice_array(const gslice_array<_Tp>& __a)
: _M_array(__a._M_array), _M_index(__a._M_index) {} : _M_array(__a._M_array), _M_index(__a._M_index) {}
template<typename _Tp> template<typename _Tp>
inline void inline void
gslice_array<_Tp>::operator=(const _Tp& __t) const gslice_array<_Tp>::operator=(const _Tp& __t) const
{ {
std::__valarray_fill(_M_array, _Array<size_t>(_M_index), std::__valarray_fill(_M_array, _Array<size_t>(_M_index),
_M_index.size(), __t); _M_index.size(), __t);
} }
template<typename _Tp> template<typename _Tp>
...@@ -178,8 +178,8 @@ namespace std { ...@@ -178,8 +178,8 @@ namespace std {
} \ } \
\ \
template<typename _Tp> \ template<typename _Tp> \
template<class _Dom> \ template<class _Dom> \
inline void \ inline void \
gslice_array<_Tp>::operator _Op##= (const _Expr<_Dom, _Tp>& __e) const\ gslice_array<_Tp>::operator _Op##= (const _Expr<_Dom, _Tp>& __e) const\
{ \ { \
_Array_augmented_##_Name(_M_array, _Array<size_t>(_M_index), __e,\ _Array_augmented_##_Name(_M_array, _Array<size_t>(_M_index), __e,\
...@@ -187,9 +187,9 @@ namespace std { ...@@ -187,9 +187,9 @@ namespace std {
} }
_DEFINE_VALARRAY_OPERATOR(*, __multiplies) _DEFINE_VALARRAY_OPERATOR(*, __multiplies)
_DEFINE_VALARRAY_OPERATOR(/, __divides) _DEFINE_VALARRAY_OPERATOR(/, __divides)
_DEFINE_VALARRAY_OPERATOR(%, __modulus) _DEFINE_VALARRAY_OPERATOR(%, __modulus)
_DEFINE_VALARRAY_OPERATOR(+, __plus) _DEFINE_VALARRAY_OPERATOR(+, __plus)
_DEFINE_VALARRAY_OPERATOR(-, __minus) _DEFINE_VALARRAY_OPERATOR(-, __minus)
_DEFINE_VALARRAY_OPERATOR(^, __bitwise_xor) _DEFINE_VALARRAY_OPERATOR(^, __bitwise_xor)
_DEFINE_VALARRAY_OPERATOR(&, __bitwise_and) _DEFINE_VALARRAY_OPERATOR(&, __bitwise_and)
......
...@@ -67,7 +67,7 @@ namespace std ...@@ -67,7 +67,7 @@ namespace std
/// Assignment operator. Assigns elements to corresponding elements /// Assignment operator. Assigns elements to corresponding elements
/// of @a a. /// of @a a.
indirect_array& operator=(const indirect_array&); indirect_array& operator=(const indirect_array&);
/// Assign slice elements to corresponding elements of @a v. /// Assign slice elements to corresponding elements of @a v.
void operator=(const valarray<_Tp>&) const; void operator=(const valarray<_Tp>&) const;
/// Multiply slice elements by corresponding elements of @a v. /// Multiply slice elements by corresponding elements of @a v.
...@@ -75,11 +75,11 @@ namespace std ...@@ -75,11 +75,11 @@ namespace std
/// Divide slice elements by corresponding elements of @a v. /// Divide slice elements by corresponding elements of @a v.
void operator/=(const valarray<_Tp>&) const; void operator/=(const valarray<_Tp>&) const;
/// Modulo slice elements by corresponding elements of @a v. /// 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. /// Add corresponding elements of @a v to slice elements.
void operator+=(const valarray<_Tp>&) const; void operator+=(const valarray<_Tp>&) const;
/// Subtract corresponding elements of @a v from slice elements. /// 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. /// Logical xor slice elements with corresponding elements of @a v.
void operator^=(const valarray<_Tp>&) const; void operator^=(const valarray<_Tp>&) const;
/// Logical and slice elements with corresponding elements of @a v. /// Logical and slice elements with corresponding elements of @a v.
...@@ -89,11 +89,11 @@ namespace std ...@@ -89,11 +89,11 @@ namespace std
/// Left shift slice elements by corresponding elements of @a v. /// Left shift slice elements by corresponding elements of @a v.
void operator<<=(const valarray<_Tp>&) const; void operator<<=(const valarray<_Tp>&) const;
/// Right shift slice elements by corresponding elements of @a v. /// 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. /// Assign all slice elements to @a t.
void operator= (const _Tp&) const; void operator= (const _Tp&) const;
// ~indirect_array(); // ~indirect_array();
template<class _Dom> template<class _Dom>
void operator=(const _Expr<_Dom, _Tp>&) const; void operator=(const _Expr<_Dom, _Tp>&) const;
template<class _Dom> template<class _Dom>
...@@ -115,7 +115,7 @@ namespace std ...@@ -115,7 +115,7 @@ namespace std
template<class _Dom> template<class _Dom>
void operator<<=(const _Expr<_Dom, _Tp>&) const; void operator<<=(const _Expr<_Dom, _Tp>&) const;
template<class _Dom> template<class _Dom>
void operator>>=(const _Expr<_Dom, _Tp>&) const; void operator>>=(const _Expr<_Dom, _Tp>&) const;
private: private:
/// Copy constructor. Both slices refer to the same underlying array. /// Copy constructor. Both slices refer to the same underlying array.
...@@ -124,23 +124,23 @@ namespace std ...@@ -124,23 +124,23 @@ namespace std
friend class valarray<_Tp>; friend class valarray<_Tp>;
friend class gslice_array<_Tp>; friend class gslice_array<_Tp>;
const size_t _M_sz; const size_t _M_sz;
const _Array<size_t> _M_index; const _Array<size_t> _M_index;
const _Array<_Tp> _M_array; const _Array<_Tp> _M_array;
// not implemented // not implemented
indirect_array(); indirect_array();
}; };
template<typename _Tp> template<typename _Tp>
inline inline
indirect_array<_Tp>::indirect_array(const indirect_array<_Tp>& __a) 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) {} : _M_sz(__a._M_sz), _M_index(__a._M_index), _M_array(__a._M_array) {}
template<typename _Tp> template<typename _Tp>
inline 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) _Array<size_t> __i)
: _M_sz(__s), _M_index(__i), _M_array(__a) {} : _M_sz(__s), _M_index(__i), _M_array(__a) {}
......
...@@ -78,7 +78,7 @@ namespace __gnu_norm ...@@ -78,7 +78,7 @@ namespace __gnu_norm
_M_put_node(__tmp); _M_put_node(__tmp);
} }
} }
template<typename _Tp, typename _Alloc> template<typename _Tp, typename _Alloc>
typename list<_Tp,_Alloc>::iterator typename list<_Tp,_Alloc>::iterator
list<_Tp,_Alloc>:: list<_Tp,_Alloc>::
...@@ -88,7 +88,7 @@ namespace __gnu_norm ...@@ -88,7 +88,7 @@ namespace __gnu_norm
__tmp->hook(__position._M_node); __tmp->hook(__position._M_node);
return __tmp; return __tmp;
} }
template<typename _Tp, typename _Alloc> template<typename _Tp, typename _Alloc>
typename list<_Tp,_Alloc>::iterator typename list<_Tp,_Alloc>::iterator
list<_Tp,_Alloc>:: list<_Tp,_Alloc>::
...@@ -98,7 +98,7 @@ namespace __gnu_norm ...@@ -98,7 +98,7 @@ namespace __gnu_norm
_M_erase(__position); _M_erase(__position);
return __ret; return __ret;
} }
template<typename _Tp, typename _Alloc> template<typename _Tp, typename _Alloc>
void void
list<_Tp,_Alloc>:: list<_Tp,_Alloc>::
...@@ -113,7 +113,7 @@ namespace __gnu_norm ...@@ -113,7 +113,7 @@ namespace __gnu_norm
else // __i == end() else // __i == end()
insert(end(), __new_size - __len, __x); insert(end(), __new_size - __len, __x);
} }
template<typename _Tp, typename _Alloc> template<typename _Tp, typename _Alloc>
list<_Tp,_Alloc>& list<_Tp,_Alloc>&
list<_Tp,_Alloc>:: list<_Tp,_Alloc>::
...@@ -134,7 +134,7 @@ namespace __gnu_norm ...@@ -134,7 +134,7 @@ namespace __gnu_norm
} }
return *this; return *this;
} }
template<typename _Tp, typename _Alloc> template<typename _Tp, typename _Alloc>
void void
list<_Tp,_Alloc>:: list<_Tp,_Alloc>::
...@@ -148,17 +148,17 @@ namespace __gnu_norm ...@@ -148,17 +148,17 @@ namespace __gnu_norm
else else
erase(__i, end()); erase(__i, end());
} }
template<typename _Tp, typename _Alloc> template<typename _Tp, typename _Alloc>
template <typename _InputIterator> template <typename _InputIterator>
void void
list<_Tp,_Alloc>:: list<_Tp,_Alloc>::
_M_assign_dispatch(_InputIterator __first2, _InputIterator __last2, _M_assign_dispatch(_InputIterator __first2, _InputIterator __last2,
__false_type) __false_type)
{ {
iterator __first1 = begin(); iterator __first1 = begin();
iterator __last1 = end(); iterator __last1 = end();
for (; __first1 != __last1 && __first2 != __last2; for (; __first1 != __last1 && __first2 != __last2;
++__first1, ++__first2) ++__first1, ++__first2)
*__first1 = *__first2; *__first1 = *__first2;
if (__first2 == __last2) if (__first2 == __last2)
...@@ -166,7 +166,7 @@ namespace __gnu_norm ...@@ -166,7 +166,7 @@ namespace __gnu_norm
else else
insert(__last1, __first2, __last2); insert(__last1, __first2, __last2);
} }
template<typename _Tp, typename _Alloc> template<typename _Tp, typename _Alloc>
void void
list<_Tp,_Alloc>:: list<_Tp,_Alloc>::
...@@ -183,7 +183,7 @@ namespace __gnu_norm ...@@ -183,7 +183,7 @@ namespace __gnu_norm
__first = __next; __first = __next;
} }
} }
template<typename _Tp, typename _Alloc> template<typename _Tp, typename _Alloc>
void void
list<_Tp,_Alloc>:: list<_Tp,_Alloc>::
...@@ -203,7 +203,7 @@ namespace __gnu_norm ...@@ -203,7 +203,7 @@ namespace __gnu_norm
__next = __first; __next = __first;
} }
} }
template<typename _Tp, typename _Alloc> template<typename _Tp, typename _Alloc>
void void
list<_Tp,_Alloc>:: list<_Tp,_Alloc>::
...@@ -230,14 +230,14 @@ namespace __gnu_norm ...@@ -230,14 +230,14 @@ namespace __gnu_norm
_M_transfer(__last1, __first2, __last2); _M_transfer(__last1, __first2, __last2);
} }
} }
template<typename _Tp, typename _Alloc> template<typename _Tp, typename _Alloc>
void void
list<_Tp,_Alloc>:: list<_Tp,_Alloc>::
sort() sort()
{ {
// Do nothing if the list has length 0 or 1. // 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) && this->_M_node._M_next->_M_next != &this->_M_node)
{ {
list __carry; list __carry;
...@@ -248,7 +248,7 @@ namespace __gnu_norm ...@@ -248,7 +248,7 @@ namespace __gnu_norm
do do
{ {
__carry.splice(__carry.begin(), *this, begin()); __carry.splice(__carry.begin(), *this, begin());
for(__counter = &__tmp[0]; for(__counter = &__tmp[0];
(__counter != __fill) && !__counter->empty(); (__counter != __fill) && !__counter->empty();
++__counter) ++__counter)
...@@ -267,7 +267,7 @@ namespace __gnu_norm ...@@ -267,7 +267,7 @@ namespace __gnu_norm
swap( *(__fill-1) ); swap( *(__fill-1) );
} }
} }
template<typename _Tp, typename _Alloc> template<typename _Tp, typename _Alloc>
template <typename _Predicate> template <typename _Predicate>
void void
...@@ -285,7 +285,7 @@ namespace __gnu_norm ...@@ -285,7 +285,7 @@ namespace __gnu_norm
__first = __next; __first = __next;
} }
} }
template<typename _Tp, typename _Alloc> template<typename _Tp, typename _Alloc>
template <typename _BinaryPredicate> template <typename _BinaryPredicate>
void void
...@@ -305,7 +305,7 @@ namespace __gnu_norm ...@@ -305,7 +305,7 @@ namespace __gnu_norm
__next = __first; __next = __first;
} }
} }
template<typename _Tp, typename _Alloc> template<typename _Tp, typename _Alloc>
template <typename _StrictWeakOrdering> template <typename _StrictWeakOrdering>
void void
...@@ -313,7 +313,7 @@ namespace __gnu_norm ...@@ -313,7 +313,7 @@ namespace __gnu_norm
merge(list& __x, _StrictWeakOrdering __comp) merge(list& __x, _StrictWeakOrdering __comp)
{ {
// _GLIBCXX_RESOLVE_LIB_DEFECTS // _GLIBCXX_RESOLVE_LIB_DEFECTS
// 300. list::merge() specification incomplete // 300. list::merge() specification incomplete
if (this != &__x) if (this != &__x)
{ {
iterator __first1 = begin(); iterator __first1 = begin();
...@@ -333,7 +333,7 @@ namespace __gnu_norm ...@@ -333,7 +333,7 @@ namespace __gnu_norm
_M_transfer(__last1, __first2, __last2); _M_transfer(__last1, __first2, __last2);
} }
} }
template<typename _Tp, typename _Alloc> template<typename _Tp, typename _Alloc>
template <typename _StrictWeakOrdering> template <typename _StrictWeakOrdering>
void void
...@@ -348,11 +348,11 @@ namespace __gnu_norm ...@@ -348,11 +348,11 @@ namespace __gnu_norm
list __tmp[64]; list __tmp[64];
list * __fill = &__tmp[0]; list * __fill = &__tmp[0];
list * __counter; list * __counter;
do do
{ {
__carry.splice(__carry.begin(), *this, begin()); __carry.splice(__carry.begin(), *this, begin());
for(__counter = &__tmp[0]; for(__counter = &__tmp[0];
(__counter != __fill) && !__counter->empty(); (__counter != __fill) && !__counter->empty();
++__counter) ++__counter)
...@@ -365,7 +365,7 @@ namespace __gnu_norm ...@@ -365,7 +365,7 @@ namespace __gnu_norm
++__fill; ++__fill;
} }
while ( !empty() ); while ( !empty() );
for (__counter = &__tmp[1]; __counter != __fill; ++__counter) for (__counter = &__tmp[1]; __counter != __fill; ++__counter)
__counter->merge( *(__counter-1), __comp ); __counter->merge( *(__counter-1), __comp );
swap( *(__fill-1) ); swap( *(__fill-1) );
......
...@@ -80,16 +80,16 @@ namespace std ...@@ -80,16 +80,16 @@ namespace std
friend class _Impl; friend class _Impl;
template<typename _Facet> template<typename _Facet>
friend bool friend bool
has_facet(const locale&) throw(); has_facet(const locale&) throw();
template<typename _Facet> template<typename _Facet>
friend const _Facet& friend const _Facet&
use_facet(const locale&); use_facet(const locale&);
template<typename _Cache> template<typename _Cache>
friend struct __use_cache; friend struct __use_cache;
//@{ //@{
/** /**
* @brief Category values. * @brief Category values.
...@@ -103,18 +103,18 @@ namespace std ...@@ -103,18 +103,18 @@ namespace std
* @endif * @endif
*/ */
static const category none = 0; static const category none = 0;
static const category ctype = 1L << 0; static const category ctype = 1L << 0;
static const category numeric = 1L << 1; static const category numeric = 1L << 1;
static const category collate = 1L << 2; static const category collate = 1L << 2;
static const category time = 1L << 3; static const category time = 1L << 3;
static const category monetary = 1L << 4; static const category monetary = 1L << 4;
static const category messages = 1L << 5; static const category messages = 1L << 5;
static const category all = (ctype | numeric | collate | static const category all = (ctype | numeric | collate |
time | monetary | messages); time | monetary | messages);
//@} //@}
// Construct/copy/destroy: // Construct/copy/destroy:
/** /**
* @brief Default constructor. * @brief Default constructor.
* *
...@@ -140,7 +140,7 @@ namespace std ...@@ -140,7 +140,7 @@ namespace std
* @param s Name of the locale to construct. * @param s Name of the locale to construct.
* @throw std::runtime_error if s is null or an undefined locale. * @throw std::runtime_error if s is null or an undefined locale.
*/ */
explicit explicit
locale(const char* __s); locale(const char* __s);
/** /**
...@@ -152,7 +152,7 @@ namespace std ...@@ -152,7 +152,7 @@ namespace std
* *
* @param base The locale to copy. * @param base The locale to copy.
* @param s Name of the locale to use facets from. * @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. * @throw std::runtime_error if s is null or an undefined locale.
*/ */
locale(const locale& __base, const char* __s, category __cat); locale(const locale& __base, const char* __s, category __cat);
...@@ -210,7 +210,7 @@ namespace std ...@@ -210,7 +210,7 @@ namespace std
* @throw std::runtime_error if other has no facet of type Facet. * @throw std::runtime_error if other has no facet of type Facet.
*/ */
template<typename _Facet> template<typename _Facet>
locale locale
combine(const locale& __other) const; combine(const locale& __other) const;
// Locale operations: // Locale operations:
...@@ -218,7 +218,7 @@ namespace std ...@@ -218,7 +218,7 @@ namespace std
* @brief Return locale name. * @brief Return locale name.
* @return Locale name or "*" if unnamed. * @return Locale name or "*" if unnamed.
*/ */
string string
name() const; name() const;
/** /**
...@@ -226,9 +226,9 @@ namespace std ...@@ -226,9 +226,9 @@ namespace std
* *
* @param other The locale to compare against. * @param other The locale to compare against.
* @return True if other and this refer to the same locale instance, are * @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 (); operator==(const locale& __other) const throw ();
/** /**
...@@ -237,7 +237,7 @@ namespace std ...@@ -237,7 +237,7 @@ namespace std
* @param other The locale to compare against. * @param other The locale to compare against.
* @return ! (*this == other) * @return ! (*this == other)
*/ */
inline bool inline bool
operator!=(const locale& __other) const throw () operator!=(const locale& __other) const throw ()
{ return !(this->operator==(__other)); } { return !(this->operator==(__other)); }
...@@ -257,7 +257,7 @@ namespace std ...@@ -257,7 +257,7 @@ namespace std
* @return True if collate<Char> facet compares s1 < s2, else false. * @return True if collate<Char> facet compares s1 < s2, else false.
*/ */
template<typename _Char, typename _Traits, typename _Alloc> template<typename _Char, typename _Traits, typename _Alloc>
bool bool
operator()(const basic_string<_Char, _Traits, _Alloc>& __s1, operator()(const basic_string<_Char, _Traits, _Alloc>& __s1,
const basic_string<_Char, _Traits, _Alloc>& __s2) const; const basic_string<_Char, _Traits, _Alloc>& __s2) const;
...@@ -272,26 +272,26 @@ namespace std ...@@ -272,26 +272,26 @@ namespace std
* @param locale The new locale to make global. * @param locale The new locale to make global.
* @return Copy of the old global locale. * @return Copy of the old global locale.
*/ */
static locale static locale
global(const locale&); global(const locale&);
/** /**
* @brief Return reference to the "C" locale. * @brief Return reference to the "C" locale.
*/ */
static const locale& static const locale&
classic(); classic();
private: private:
// The (shared) implementation // The (shared) implementation
_Impl* _M_impl; _Impl* _M_impl;
// The "C" reference locale // The "C" reference locale
static _Impl* _S_classic; static _Impl* _S_classic;
// Current global locale // 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 // NB: locale::global() has to know how to modify all the
// underlying categories, not just the ones required by the C++ // underlying categories, not just the ones required by the C++
// standard. // standard.
...@@ -313,16 +313,16 @@ namespace std ...@@ -313,16 +313,16 @@ namespace std
static __gthread_once_t _S_once; static __gthread_once_t _S_once;
#endif #endif
explicit explicit
locale(_Impl*) throw(); locale(_Impl*) throw();
static void static void
_S_initialize(); _S_initialize();
static void static void
_S_initialize_once(); _S_initialize_once();
static category static category
_S_normalize_category(category); _S_normalize_category(category);
void void
...@@ -355,10 +355,10 @@ namespace std ...@@ -355,10 +355,10 @@ namespace std
static const char _S_c_name[2]; static const char _S_c_name[2];
#ifdef __GTHREADS #ifdef __GTHREADS
static __gthread_once_t _S_once; static __gthread_once_t _S_once;
#endif #endif
static void static void
_S_initialize_once(); _S_initialize_once();
protected: protected:
...@@ -371,16 +371,16 @@ namespace std ...@@ -371,16 +371,16 @@ namespace std
* *
* @param refs The initial value for reference count. * @param refs The initial value for reference count.
*/ */
explicit explicit
facet(size_t __refs = 0) throw() : _M_refcount(__refs ? 1 : 0) facet(size_t __refs = 0) throw() : _M_refcount(__refs ? 1 : 0)
{ } { }
/// Facet destructor. /// Facet destructor.
virtual virtual
~facet(); ~facet();
static void 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); __c_locale __old = 0);
static __c_locale static __c_locale
...@@ -407,16 +407,16 @@ namespace std ...@@ -407,16 +407,16 @@ namespace std
{ {
if (__exchange_and_add(&_M_refcount, -1) == 1) if (__exchange_and_add(&_M_refcount, -1) == 1)
{ {
try try
{ delete this; } { delete this; }
catch (...) catch (...)
{ } { }
} }
} }
facet(const facet&); // Not defined. facet(const facet&); // Not defined.
void void
operator=(const facet&); // Not defined. operator=(const facet&); // Not defined.
}; };
...@@ -438,22 +438,22 @@ namespace std ...@@ -438,22 +438,22 @@ namespace std
friend class locale::_Impl; friend class locale::_Impl;
template<typename _Facet> template<typename _Facet>
friend const _Facet& friend const _Facet&
use_facet(const locale&); use_facet(const locale&);
template<typename _Facet> template<typename _Facet>
friend bool friend bool
has_facet(const locale&) throw (); has_facet(const locale&) throw ();
// NB: There is no accessor for _M_index because it may be used // NB: There is no accessor for _M_index because it may be used
// before the constructor is run; the effect of calling a member // before the constructor is run; the effect of calling a member
// function (even an inline) would be undefined. // function (even an inline) would be undefined.
mutable size_t _M_index; mutable size_t _M_index;
// Last id number assigned. // Last id number assigned.
static _Atomic_word _S_refcount; static _Atomic_word _S_refcount;
void void
operator=(const id&); // Not defined. operator=(const id&); // Not defined.
id(const id&); // Not defined. id(const id&); // Not defined.
...@@ -478,11 +478,11 @@ namespace std ...@@ -478,11 +478,11 @@ namespace std
friend class locale::facet; friend class locale::facet;
template<typename _Facet> template<typename _Facet>
friend bool friend bool
has_facet(const locale&) throw(); has_facet(const locale&) throw();
template<typename _Facet> template<typename _Facet>
friend const _Facet& friend const _Facet&
use_facet(const locale&); use_facet(const locale&);
template<typename _Cache> template<typename _Cache>
...@@ -492,29 +492,29 @@ namespace std ...@@ -492,29 +492,29 @@ namespace std
// Data Members. // Data Members.
_Atomic_word _M_refcount; _Atomic_word _M_refcount;
const facet** _M_facets; const facet** _M_facets;
size_t _M_facets_size; size_t _M_facets_size;
const facet** _M_caches; const facet** _M_caches;
char** _M_names; char** _M_names;
static const locale::id* const _S_id_ctype[]; static const locale::id* const _S_id_ctype[];
static const locale::id* const _S_id_numeric[]; static const locale::id* const _S_id_numeric[];
static const locale::id* const _S_id_collate[]; static const locale::id* const _S_id_collate[];
static const locale::id* const _S_id_time[]; static const locale::id* const _S_id_time[];
static const locale::id* const _S_id_monetary[]; static const locale::id* const _S_id_monetary[];
static const locale::id* const _S_id_messages[]; static const locale::id* const _S_id_messages[];
static const locale::id* const* const _S_facet_categories[]; static const locale::id* const* const _S_facet_categories[];
inline void inline void
_M_add_reference() throw() _M_add_reference() throw()
{ __atomic_add(&_M_refcount, 1); } { __atomic_add(&_M_refcount, 1); }
inline void inline void
_M_remove_reference() throw() _M_remove_reference() throw()
{ {
if (__exchange_and_add(&_M_refcount, -1) == 1) if (__exchange_and_add(&_M_refcount, -1) == 1)
{ {
try try
{ delete this; } { delete this; }
catch(...) catch(...)
{ } { }
} }
} }
...@@ -527,7 +527,7 @@ namespace std ...@@ -527,7 +527,7 @@ namespace std
_Impl(const _Impl&); // Not defined. _Impl(const _Impl&); // Not defined.
void void
operator=(const _Impl&); // Not defined. operator=(const _Impl&); // Not defined.
inline bool inline bool
...@@ -539,29 +539,29 @@ namespace std ...@@ -539,29 +539,29 @@ namespace std
return __ret; return __ret;
} }
void void
_M_replace_categories(const _Impl*, category); _M_replace_categories(const _Impl*, category);
void void
_M_replace_category(const _Impl*, const locale::id* const*); _M_replace_category(const _Impl*, const locale::id* const*);
void void
_M_replace_facet(const _Impl*, const locale::id*); _M_replace_facet(const _Impl*, const locale::id*);
void void
_M_install_facet(const locale::id*, const facet*); _M_install_facet(const locale::id*, const facet*);
template<typename _Facet> template<typename _Facet>
inline void inline void
_M_init_facet(_Facet* __facet) _M_init_facet(_Facet* __facet)
{ _M_install_facet(&_Facet::id, __facet); } { _M_install_facet(&_Facet::id, __facet); }
void void
_M_install_cache(const facet* __cache, size_t __index) throw() _M_install_cache(const facet* __cache, size_t __index) throw()
{ {
__cache->_M_add_reference(); __cache->_M_add_reference();
_M_caches[__index] = __cache; _M_caches[__index] = __cache;
} }
}; };
template<typename _Facet> template<typename _Facet>
...@@ -584,7 +584,7 @@ namespace std ...@@ -584,7 +584,7 @@ namespace std
{ {
_M_impl->_M_remove_reference(); _M_impl->_M_remove_reference();
for (size_t __j = 0; __j < __i; ++__j) for (size_t __j = 0; __j < __i; ++__j)
delete [] _M_tmp_names[__j]; delete [] _M_tmp_names[__j];
__throw_exception_again; __throw_exception_again;
} }
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
#include <bits/c++config.h> #include <bits/c++config.h>
#include <bits/c++locale.h> // Defines __c_locale, config-specific includes #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> #include <bits/functexcept.h>
namespace std namespace std
...@@ -53,67 +53,67 @@ namespace std ...@@ -53,67 +53,67 @@ namespace std
class locale; class locale;
// 22.1.3 Convenience interfaces // 22.1.3 Convenience interfaces
template<typename _CharT> template<typename _CharT>
inline bool inline bool
isspace(_CharT, const locale&); isspace(_CharT, const locale&);
template<typename _CharT> template<typename _CharT>
inline bool inline bool
isprint(_CharT, const locale&); isprint(_CharT, const locale&);
template<typename _CharT> template<typename _CharT>
inline bool inline bool
iscntrl(_CharT, const locale&); iscntrl(_CharT, const locale&);
template<typename _CharT> template<typename _CharT>
inline bool inline bool
isupper(_CharT, const locale&); isupper(_CharT, const locale&);
template<typename _CharT> template<typename _CharT>
inline bool inline bool
islower(_CharT, const locale&); islower(_CharT, const locale&);
template<typename _CharT> template<typename _CharT>
inline bool inline bool
isalpha(_CharT, const locale&); isalpha(_CharT, const locale&);
template<typename _CharT> template<typename _CharT>
inline bool inline bool
isdigit(_CharT, const locale&); isdigit(_CharT, const locale&);
template<typename _CharT> template<typename _CharT>
inline bool inline bool
ispunct(_CharT, const locale&); ispunct(_CharT, const locale&);
template<typename _CharT> template<typename _CharT>
inline bool inline bool
isxdigit(_CharT, const locale&); isxdigit(_CharT, const locale&);
template<typename _CharT> template<typename _CharT>
inline bool inline bool
isalnum(_CharT, const locale&); isalnum(_CharT, const locale&);
template<typename _CharT> template<typename _CharT>
inline bool inline bool
isgraph(_CharT, const locale&); isgraph(_CharT, const locale&);
template<typename _CharT> template<typename _CharT>
inline _CharT inline _CharT
toupper(_CharT, const locale&); toupper(_CharT, const locale&);
template<typename _CharT> template<typename _CharT>
inline _CharT inline _CharT
tolower(_CharT, const locale&); tolower(_CharT, const locale&);
// 22.2.1 and 22.2.1.3 ctype // 22.2.1 and 22.2.1.3 ctype
class ctype_base; class ctype_base;
template<typename _CharT> template<typename _CharT>
class ctype; class ctype;
template<> class ctype<char>; template<> class ctype<char>;
#ifdef _GLIBCXX_USE_WCHAR_T #ifdef _GLIBCXX_USE_WCHAR_T
template<> class ctype<wchar_t>; template<> class ctype<wchar_t>;
#endif #endif
template<typename _CharT> template<typename _CharT>
class ctype_byname; class ctype_byname;
// NB: Specialized for char and wchar_t in locale_facets.h. // NB: Specialized for char and wchar_t in locale_facets.h.
...@@ -137,9 +137,9 @@ namespace std ...@@ -137,9 +137,9 @@ namespace std
template<typename _CharT> class numpunct_byname; template<typename _CharT> class numpunct_byname;
// 22.2.4 collation // 22.2.4 collation
template<typename _CharT> template<typename _CharT>
class collate; class collate;
template<typename _CharT> class template<typename _CharT> class
collate_byname; collate_byname;
// 22.2.5 date and time // 22.2.5 date and time
...@@ -159,16 +159,16 @@ namespace std ...@@ -159,16 +159,16 @@ namespace std
class money_get; class money_get;
template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> > template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
class money_put; class money_put;
template<typename _CharT, bool _Intl = false> template<typename _CharT, bool _Intl = false>
class moneypunct; class moneypunct;
template<typename _CharT, bool _Intl = false> template<typename _CharT, bool _Intl = false>
class moneypunct_byname; class moneypunct_byname;
// 22.2.7 message retrieval // 22.2.7 message retrieval
class messages_base; class messages_base;
template<typename _CharT> template<typename _CharT>
class messages; class messages;
template<typename _CharT> template<typename _CharT>
class messages_byname; class messages_byname;
template<typename _Facet> template<typename _Facet>
...@@ -182,9 +182,9 @@ namespace std ...@@ -182,9 +182,9 @@ namespace std
template<typename _Facet> template<typename _Facet>
inline const _Facet& inline const _Facet&
__check_facet(const _Facet* __f) __check_facet(const _Facet* __f)
{ {
if (!__f) if (!__f)
__throw_bad_cast(); __throw_bad_cast();
return *__f; return *__f;
} }
} // namespace std } // namespace std
......
...@@ -57,23 +57,23 @@ namespace std { ...@@ -57,23 +57,23 @@ namespace std {
* *
* @param Tp Element type. * @param Tp Element type.
*/ */
template <class _Tp> template <class _Tp>
class mask_array class mask_array
{ {
public: public:
typedef _Tp value_type; typedef _Tp value_type;
void operator=(const valarray<_Tp>&) const; void operator=(const valarray<_Tp>&) const;
/// Multiply slice elements by corresponding elements of @a v. /// Multiply slice elements by corresponding elements of @a v.
void operator*=(const valarray<_Tp>&) const; void operator*=(const valarray<_Tp>&) const;
/// Divide slice elements by corresponding elements of @a v. /// Divide slice elements by corresponding elements of @a v.
void operator/=(const valarray<_Tp>&) const; void operator/=(const valarray<_Tp>&) const;
/// Modulo slice elements by corresponding elements of @a v. /// 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. /// Add corresponding elements of @a v to slice elements.
void operator+=(const valarray<_Tp>&) const; void operator+=(const valarray<_Tp>&) const;
/// Subtract corresponding elements of @a v from slice elements. /// 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. /// Logical xor slice elements with corresponding elements of @a v.
void operator^=(const valarray<_Tp>&) const; void operator^=(const valarray<_Tp>&) const;
/// Logical and slice elements with corresponding elements of @a v. /// Logical and slice elements with corresponding elements of @a v.
...@@ -83,12 +83,12 @@ namespace std { ...@@ -83,12 +83,12 @@ namespace std {
/// Left shift slice elements by corresponding elements of @a v. /// Left shift slice elements by corresponding elements of @a v.
void operator<<=(const valarray<_Tp>&) const; void operator<<=(const valarray<_Tp>&) const;
/// Right shift slice elements by corresponding elements of @a v. /// 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. /// Assign all slice elements to @a t.
void operator=(const _Tp&) const; void operator=(const _Tp&) const;
// ~mask_array (); // ~mask_array ();
template<class _Dom> template<class _Dom>
void operator=(const _Expr<_Dom,_Tp>&) const; void operator=(const _Expr<_Dom,_Tp>&) const;
template<class _Dom> template<class _Dom>
...@@ -110,19 +110,19 @@ namespace std { ...@@ -110,19 +110,19 @@ namespace std {
template<class _Dom> template<class _Dom>
void operator<<=(const _Expr<_Dom,_Tp>&) const; void operator<<=(const _Expr<_Dom,_Tp>&) const;
template<class _Dom> template<class _Dom>
void operator>>=(const _Expr<_Dom,_Tp>&) const; void operator>>=(const _Expr<_Dom,_Tp>&) const;
private: private:
mask_array(_Array<_Tp>, size_t, _Array<bool>); mask_array(_Array<_Tp>, size_t, _Array<bool>);
friend class valarray<_Tp>; friend class valarray<_Tp>;
const size_t _M_sz; const size_t _M_sz;
const _Array<bool> _M_mask; const _Array<bool> _M_mask;
const _Array<_Tp> _M_array; const _Array<_Tp> _M_array;
/// Copy constructor. Both slices refer to the same underlying array. /// Copy constructor. Both slices refer to the same underlying array.
mask_array (const mask_array&); mask_array (const mask_array&);
// not implemented // not implemented
mask_array(); mask_array();
...@@ -137,15 +137,15 @@ namespace std { ...@@ -137,15 +137,15 @@ namespace std {
: _M_sz(a._M_sz), _M_mask(a._M_mask), _M_array(a._M_array) {} : _M_sz(a._M_sz), _M_mask(a._M_mask), _M_array(a._M_array) {}
template<typename _Tp> template<typename _Tp>
inline inline
mask_array<_Tp>::mask_array(_Array<_Tp> __a, size_t __s, _Array<bool> __m) mask_array<_Tp>::mask_array(_Array<_Tp> __a, size_t __s, _Array<bool> __m)
: _M_sz(__s), _M_mask(__m), _M_array(__a) {} : _M_sz(__s), _M_mask(__m), _M_array(__a) {}
template<typename _Tp> template<typename _Tp>
inline void inline void
mask_array<_Tp>::operator=(const _Tp& __t) const mask_array<_Tp>::operator=(const _Tp& __t) const
{ std::__valarray_fill(_M_array, _M_sz, _M_mask, __t); } { std::__valarray_fill(_M_array, _M_sz, _M_mask, __t); }
template<typename _Tp> template<typename _Tp>
inline void inline void
mask_array<_Tp>::operator=(const valarray<_Tp>& __v) const mask_array<_Tp>::operator=(const valarray<_Tp>& __v) const
...@@ -186,8 +186,8 @@ _DEFINE_VALARRAY_OPERATOR(|, __bitwise_or) ...@@ -186,8 +186,8 @@ _DEFINE_VALARRAY_OPERATOR(|, __bitwise_or)
_DEFINE_VALARRAY_OPERATOR(<<, __shift_left) _DEFINE_VALARRAY_OPERATOR(<<, __shift_left)
_DEFINE_VALARRAY_OPERATOR(>>, __shift_right) _DEFINE_VALARRAY_OPERATOR(>>, __shift_right)
#undef _DEFINE_VALARRAY_OPERATOR #undef _DEFINE_VALARRAY_OPERATOR
} // std:: } // std::
#endif /* _MASK_ARRAY_H */ #endif /* _MASK_ARRAY_H */
......
...@@ -158,8 +158,8 @@ namespace std ...@@ -158,8 +158,8 @@ namespace std
private: private:
friend class streamoff; friend class streamoff;
__streamoff_base_type _M_off; __streamoff_base_type _M_off;
_StateT _M_state; _StateT _M_state;
public: public:
// The standard doesn't require that fpos objects can be default // The standard doesn't require that fpos objects can be default
......
...@@ -69,14 +69,14 @@ namespace std ...@@ -69,14 +69,14 @@ namespace std
* @param s Stride between array elements. * @param s Stride between array elements.
*/ */
slice(size_t, size_t, size_t); slice(size_t, size_t, size_t);
/// Return array offset of first slice element. /// Return array offset of first slice element.
size_t start() const; size_t start() const;
/// Return size of slice. /// Return size of slice.
size_t size() const; size_t size() const;
/// Return array stride of slice. /// Return array stride of slice.
size_t stride() const; size_t stride() const;
private: private:
size_t _M_off; // offset size_t _M_off; // offset
size_t _M_sz; // size size_t _M_sz; // size
...@@ -85,21 +85,21 @@ namespace std ...@@ -85,21 +85,21 @@ namespace std
// The default constructor constructor is not required to initialize // The default constructor constructor is not required to initialize
// data members with any meaningful values, so we choose to do nothing. // data members with any meaningful values, so we choose to do nothing.
inline inline
slice::slice() {} slice::slice() {}
inline inline
slice::slice(size_t __o, size_t __d, size_t __s) slice::slice(size_t __o, size_t __d, size_t __s)
: _M_off(__o), _M_sz(__d), _M_st(__s) {} : _M_off(__o), _M_sz(__d), _M_st(__s) {}
inline size_t inline size_t
slice::start() const slice::start() const
{ return _M_off; } { return _M_off; }
inline size_t inline size_t
slice::size() const slice::size() const
{ return _M_sz; } { return _M_sz; }
inline size_t inline size_t
slice::stride() const slice::stride() const
{ return _M_st; } { return _M_st; }
...@@ -194,16 +194,16 @@ namespace std ...@@ -194,16 +194,16 @@ namespace std
}; };
template<typename _Tp> template<typename _Tp>
inline inline
slice_array<_Tp>::slice_array(_Array<_Tp> __a, const slice& __s) slice_array<_Tp>::slice_array(_Array<_Tp> __a, const slice& __s)
: _M_sz(__s.size()), _M_stride(__s.stride()), : _M_sz(__s.size()), _M_stride(__s.stride()),
_M_array(__a.begin() + __s.start()) {} _M_array(__a.begin() + __s.start()) {}
template<typename _Tp> template<typename _Tp>
inline inline
slice_array<_Tp>::slice_array(const slice_array<_Tp>& a) 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) {} : _M_sz(a._M_sz), _M_stride(a._M_stride), _M_array(a._M_array) {}
// template<typename _Tp> // template<typename _Tp>
// inline slice_array<_Tp>::~slice_array () {} // inline slice_array<_Tp>::~slice_array () {}
...@@ -220,12 +220,12 @@ namespace std ...@@ -220,12 +220,12 @@ namespace std
inline void inline void
slice_array<_Tp>::operator=(const _Tp& __t) const slice_array<_Tp>::operator=(const _Tp& __t) const
{ std::__valarray_fill(_M_array, _M_sz, _M_stride, __t); } { std::__valarray_fill(_M_array, _M_sz, _M_stride, __t); }
template<typename _Tp> template<typename _Tp>
inline void inline void
slice_array<_Tp>::operator=(const valarray<_Tp>& __v) const slice_array<_Tp>::operator=(const valarray<_Tp>& __v) const
{ std::__valarray_copy(_Array<_Tp>(__v), _M_array, _M_sz, _M_stride); } { std::__valarray_copy(_Array<_Tp>(__v), _M_array, _M_sz, _M_stride); }
template<typename _Tp> template<typename _Tp>
template<class _Dom> template<class _Dom>
inline void inline void
...@@ -248,7 +248,7 @@ namespace std ...@@ -248,7 +248,7 @@ namespace std
{ \ { \
_Array_augmented_##_Name(_M_array, _M_stride, __e, _M_sz); \ _Array_augmented_##_Name(_M_array, _M_stride, __e, _M_sz); \
} }
_DEFINE_VALARRAY_OPERATOR(*, __multiplies) _DEFINE_VALARRAY_OPERATOR(*, __multiplies)
_DEFINE_VALARRAY_OPERATOR(/, __divides) _DEFINE_VALARRAY_OPERATOR(/, __divides)
......
...@@ -42,13 +42,13 @@ ...@@ -42,13 +42,13 @@
namespace std namespace std
{ {
template <class _CharT, class _Traits, class _Alloc> 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>:: basic_stringbuf<_CharT, _Traits, _Alloc>::
pbackfail(int_type __c) pbackfail(int_type __c)
{ {
int_type __ret = traits_type::eof(); int_type __ret = traits_type::eof();
const bool __testeof = traits_type::eq_int_type(__c, __ret); const bool __testeof = traits_type::eq_int_type(__c, __ret);
if (this->eback() < this->gptr()) if (this->eback() < this->gptr())
{ {
const bool __testeq = traits_type::eq(traits_type::to_char_type(__c), const bool __testeq = traits_type::eq(traits_type::to_char_type(__c),
...@@ -69,9 +69,9 @@ namespace std ...@@ -69,9 +69,9 @@ namespace std
} }
return __ret; return __ret;
} }
template <class _CharT, class _Traits, class _Alloc> 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>:: basic_stringbuf<_CharT, _Traits, _Alloc>::
overflow(int_type __c) overflow(int_type __c)
{ {
...@@ -111,7 +111,7 @@ namespace std ...@@ -111,7 +111,7 @@ namespace std
} }
template <class _CharT, class _Traits, class _Alloc> 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>:: basic_stringbuf<_CharT, _Traits, _Alloc>::
underflow() underflow()
{ {
...@@ -132,7 +132,7 @@ namespace std ...@@ -132,7 +132,7 @@ namespace std
basic_stringbuf<_CharT, _Traits, _Alloc>:: basic_stringbuf<_CharT, _Traits, _Alloc>::
seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __mode) 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 __testin = (ios_base::in & this->_M_mode & __mode) != 0;
bool __testout = (ios_base::out & this->_M_mode & __mode) != 0; bool __testout = (ios_base::out & this->_M_mode & __mode) != 0;
const bool __testboth = __testin && __testout && __way != ios_base::cur; const bool __testboth = __testin && __testout && __way != ios_base::cur;
...@@ -156,14 +156,14 @@ namespace std ...@@ -156,14 +156,14 @@ namespace std
__newoffo = __newoffi = this->egptr() - __beg; __newoffo = __newoffi = this->egptr() - __beg;
if ((__testin || __testboth) if ((__testin || __testboth)
&& __newoffi + __off >= 0 && __newoffi + __off >= 0
&& this->egptr() - __beg >= __newoffi + __off) && this->egptr() - __beg >= __newoffi + __off)
{ {
this->gbump((__beg + __newoffi + __off) - this->gptr()); this->gbump((__beg + __newoffi + __off) - this->gptr());
__ret = pos_type(__newoffi); __ret = pos_type(__newoffi);
} }
if ((__testout || __testboth) if ((__testout || __testboth)
&& __newoffo + __off >= 0 && __newoffo + __off >= 0
&& this->egptr() - __beg >= __newoffo + __off) && this->egptr() - __beg >= __newoffo + __off)
{ {
this->pbump((__beg + __newoffo + __off) - this->pptr()); this->pbump((__beg + __newoffo + __off) - this->pptr());
...@@ -178,14 +178,14 @@ namespace std ...@@ -178,14 +178,14 @@ namespace std
basic_stringbuf<_CharT, _Traits, _Alloc>:: basic_stringbuf<_CharT, _Traits, _Alloc>::
seekpos(pos_type __sp, ios_base::openmode __mode) 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()) if (_M_string.capacity())
{ {
off_type __pos (__sp); off_type __pos (__sp);
const bool __testin = (ios_base::in & this->_M_mode & __mode) != 0; const bool __testin = (ios_base::in & this->_M_mode & __mode) != 0;
const bool __testout = (ios_base::out & this->_M_mode & __mode) != 0; const bool __testout = (ios_base::out & this->_M_mode & __mode) != 0;
char_type* __beg = __testin ? this->eback() : this->pbase(); char_type* __beg = __testin ? this->eback() : this->pbase();
_M_update_egptr(); _M_update_egptr();
const bool __testpos = 0 <= __pos const bool __testpos = 0 <= __pos
...@@ -203,7 +203,7 @@ namespace std ...@@ -203,7 +203,7 @@ namespace std
} }
// Inhibit implicit instantiations for required instantiations, // 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. // NB: This syntax is a GNU extension.
#if _GLIBCXX_EXTERN_TEMPLATE #if _GLIBCXX_EXTERN_TEMPLATE
extern template class basic_stringbuf<char>; extern template class basic_stringbuf<char>;
......
...@@ -211,7 +211,7 @@ namespace std ...@@ -211,7 +211,7 @@ namespace std
if (*__first == __val) if (*__first == __val)
return __first; return __first;
++__first; ++__first;
if (*__first == __val) if (*__first == __val)
return __first; return __first;
++__first; ++__first;
...@@ -1624,7 +1624,7 @@ namespace std ...@@ -1624,7 +1624,7 @@ namespace std
{ {
const _ValueType __tmp = *__first; const _ValueType __tmp = *__first;
_RandomAccessIterator __p = __first; _RandomAccessIterator __p = __first;
if (__k < __l) if (__k < __l)
{ {
for (_Distance __j = 0; __j < __l / __d; __j++) for (_Distance __j = 0; __j < __l / __d; __j++)
...@@ -1652,7 +1652,7 @@ namespace std ...@@ -1652,7 +1652,7 @@ namespace std
__p -= __l; __p -= __l;
} }
} }
*__p = __tmp; *__p = __tmp;
++__first; ++__first;
} }
...@@ -1743,7 +1743,7 @@ namespace std ...@@ -1743,7 +1743,7 @@ namespace std
_RandomAccessIterator>) _RandomAccessIterator>)
__glibcxx_requires_valid_range(__first, __last); __glibcxx_requires_valid_range(__first, __last);
if (__first != __last) if (__first != __last)
for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i) for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
std::iter_swap(__i, __first + (std::rand() % ((__i - __first) + 1))); std::iter_swap(__i, __first + (std::rand() % ((__i - __first) + 1)));
} }
...@@ -1850,7 +1850,7 @@ namespace std ...@@ -1850,7 +1850,7 @@ namespace std
* @return An iterator @p middle such that @p pred(i) is true for each * @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 * iterator @p i in the range @p [first,middle) and false for each @p i
* in the range @p [middle,last). * in the range @p [middle,last).
* *
* @p pred must not modify its operand. @p partition() does not preserve * @p pred must not modify its operand. @p partition() does not preserve
* the relative ordering of elements in each group, use * the relative ordering of elements in each group, use
* @p stable_partition() if this is needed. * @p stable_partition() if this is needed.
...@@ -1959,7 +1959,7 @@ namespace std ...@@ -1959,7 +1959,7 @@ namespace std
* @return An iterator @p middle such that @p pred(i) is true for each * @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 * iterator @p i in the range @p [first,middle) and false for each @p i
* in the range @p [middle,last). * in the range @p [middle,last).
* *
* Performs the same function as @p partition() with the additional * Performs the same function as @p partition() with the additional
* guarantee that the relative ordering of elements in each group is * guarantee that the relative ordering of elements in each group is
* preserved, so any two elements @p x and @p y in the range * preserved, so any two elements @p x and @p y in the range
...@@ -2477,10 +2477,10 @@ namespace std ...@@ -2477,10 +2477,10 @@ namespace std
std::__unguarded_partition(__first, __last, std::__unguarded_partition(__first, __last,
_ValueType(std::__median(*__first, _ValueType(std::__median(*__first,
*(__first *(__first
+ (__last + (__last
- __first) - __first)
/ 2), / 2),
*(__last *(__last
- 1)))); - 1))));
std::__introsort_loop(__cut, __last, __depth_limit); std::__introsort_loop(__cut, __last, __depth_limit);
__last = __cut; __last = __cut;
...@@ -3095,7 +3095,7 @@ namespace std ...@@ -3095,7 +3095,7 @@ namespace std
__first += __two_step; __first += __two_step;
} }
__step_size = std::min(_Distance(__last - __first), __step_size); __step_size = std::min(_Distance(__last - __first), __step_size);
std::merge(__first, __first + __step_size, std::merge(__first, __first + __step_size,
__first + __step_size, __last, __first + __step_size, __last,
__result, __result,
...@@ -3673,7 +3673,7 @@ namespace std ...@@ -3673,7 +3673,7 @@ namespace std
* *
* Rearranges the elements in the range @p [first,last) so that @p *nth * 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 * 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 * whole sequence been sorted. The elements either side of @p *nth are
* not completely sorted, but for any iterator @i in the range * 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 * @p [first,nth) and any iterator @j in the range @p [nth,last) it
...@@ -3753,9 +3753,9 @@ namespace std ...@@ -3753,9 +3753,9 @@ namespace std
_RandomAccessIterator __cut = _RandomAccessIterator __cut =
std::__unguarded_partition(__first, __last, std::__unguarded_partition(__first, __last,
_ValueType(std::__median(*__first, _ValueType(std::__median(*__first,
*(__first *(__first
+ (__last + (__last
- __first) - __first)
/ 2), / 2),
*(__last - 1), *(__last - 1),
__comp)), __comp); __comp)), __comp);
...@@ -4160,7 +4160,7 @@ namespace std ...@@ -4160,7 +4160,7 @@ namespace std
*__result = *__first2; *__result = *__first2;
++__first2; ++__first2;
} }
else else
{ {
*__result = *__first1; *__result = *__first1;
++__first1; ++__first1;
...@@ -4168,7 +4168,7 @@ namespace std ...@@ -4168,7 +4168,7 @@ namespace std
} }
++__result; ++__result;
} }
return std::copy(__first2, __last2, std::copy(__first1, __last1, return std::copy(__first2, __last2, std::copy(__first1, __last1,
__result)); __result));
} }
...@@ -4225,7 +4225,7 @@ namespace std ...@@ -4225,7 +4225,7 @@ namespace std
/** /**
* @brief Return the intersection of two sorted ranges using comparison * @brief Return the intersection of two sorted ranges using comparison
* functor. * functor.
* @param first1 Start of first range. * @param first1 Start of first range.
* @param last1 End of first range. * @param last1 End of first range.
* @param first2 Start of second range. * @param first2 Start of second range.
...@@ -4446,7 +4446,7 @@ namespace std ...@@ -4446,7 +4446,7 @@ namespace std
++__first1; ++__first1;
++__first2; ++__first2;
} }
return std::copy(__first2, __last2, std::copy(__first1, return std::copy(__first2, __last2, std::copy(__first1,
__last1, __result)); __last1, __result));
} }
...@@ -4683,7 +4683,7 @@ namespace std ...@@ -4683,7 +4683,7 @@ namespace std
* comparison functor. * comparison functor.
* @param first Start of range. * @param first Start of range.
* @param last End of range. * @param last End of range.
* @param comp * @param comp
* @return False if wrapped to first permutation, true otherwise. * @return False if wrapped to first permutation, true otherwise.
* *
* Treats all permutations of the range [first,last) as a set of * Treats all permutations of the range [first,last) as a set of
...@@ -4794,7 +4794,7 @@ namespace std ...@@ -4794,7 +4794,7 @@ namespace std
* comparison functor. * comparison functor.
* @param first Start of range. * @param first Start of range.
* @param last End of range. * @param last End of range.
* @param comp * @param comp
* @return False if wrapped to last permutation, true otherwise. * @return False if wrapped to last permutation, true otherwise.
* *
* Treats all permutations of the range [first,last) as a set of * Treats all permutations of the range [first,last) as a set of
...@@ -5023,9 +5023,9 @@ namespace std ...@@ -5023,9 +5023,9 @@ namespace std
template<typename _BidirectionalIterator1, typename _BidirectionalIterator2, template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
typename _BinaryPredicate> typename _BinaryPredicate>
_BidirectionalIterator1 _BidirectionalIterator1
__find_end(_BidirectionalIterator1 __first1, __find_end(_BidirectionalIterator1 __first1,
_BidirectionalIterator1 __last1, _BidirectionalIterator1 __last1,
_BidirectionalIterator2 __first2, _BidirectionalIterator2 __first2,
_BidirectionalIterator2 __last2, _BidirectionalIterator2 __last2,
bidirectional_iterator_tag, bidirectional_iterator_tag, bidirectional_iterator_tag, bidirectional_iterator_tag,
_BinaryPredicate __comp) _BinaryPredicate __comp)
......
...@@ -126,7 +126,7 @@ namespace std ...@@ -126,7 +126,7 @@ namespace std
{ {
// concept requirements // concept requirements
__glibcxx_function_requires(_SGIAssignableConcept<_Tp>) __glibcxx_function_requires(_SGIAssignableConcept<_Tp>)
const _Tp __tmp = __a; const _Tp __tmp = __a;
__a = __b; __a = __b;
__b = __tmp; __b = __tmp;
...@@ -169,7 +169,7 @@ namespace std ...@@ -169,7 +169,7 @@ namespace std
*/ */
template<typename _Tp> template<typename _Tp>
inline const _Tp& inline const _Tp&
max(const _Tp& __a, const _Tp& __b) max(const _Tp& __a, const _Tp& __b)
{ {
// concept requirements // concept requirements
__glibcxx_function_requires(_LessThanComparableConcept<_Tp>) __glibcxx_function_requires(_LessThanComparableConcept<_Tp>)
...@@ -242,7 +242,7 @@ namespace std ...@@ -242,7 +242,7 @@ namespace std
{ {
typedef typename iterator_traits<_RandomAccessIterator>::difference_type typedef typename iterator_traits<_RandomAccessIterator>::difference_type
_Distance; _Distance;
for (_Distance __n = __last - __first; __n > 0; --__n) for (_Distance __n = __last - __first; __n > 0; --__n)
{ {
*__result = *__first; *__result = *__first;
++__first; ++__first;
...@@ -280,7 +280,7 @@ namespace std ...@@ -280,7 +280,7 @@ namespace std
template<typename _Tp> template<typename _Tp>
inline _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) __true_type)
{ return std::__copy_trivial(__first, __last, __result); } { return std::__copy_trivial(__first, __last, __result); }
...@@ -361,7 +361,7 @@ namespace std ...@@ -361,7 +361,7 @@ namespace std
template<typename _BidirectionalIterator1, typename _BidirectionalIterator2> template<typename _BidirectionalIterator1, typename _BidirectionalIterator2>
inline _BidirectionalIterator2 inline _BidirectionalIterator2
__copy_backward(_BidirectionalIterator1 __first, __copy_backward(_BidirectionalIterator1 __first,
_BidirectionalIterator1 __last, _BidirectionalIterator1 __last,
_BidirectionalIterator2 __result, _BidirectionalIterator2 __result,
bidirectional_iterator_tag) bidirectional_iterator_tag)
{ {
...@@ -372,7 +372,7 @@ namespace std ...@@ -372,7 +372,7 @@ namespace std
template<typename _RandomAccessIterator, typename _BidirectionalIterator> template<typename _RandomAccessIterator, typename _BidirectionalIterator>
inline _BidirectionalIterator inline _BidirectionalIterator
__copy_backward(_RandomAccessIterator __first, _RandomAccessIterator __last, __copy_backward(_RandomAccessIterator __first, _RandomAccessIterator __last,
_BidirectionalIterator __result, random_access_iterator_tag) _BidirectionalIterator __result, random_access_iterator_tag)
{ {
typename iterator_traits<_RandomAccessIterator>::difference_type __n; typename iterator_traits<_RandomAccessIterator>::difference_type __n;
...@@ -382,7 +382,7 @@ namespace std ...@@ -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 // have partial ordering of function templates. All we're doing is
// creating a specialization so that we can turn a call to copy_backward // creating a specialization so that we can turn a call to copy_backward
// into a memmove whenever possible. // into a memmove whenever possible.
...@@ -391,9 +391,9 @@ namespace std ...@@ -391,9 +391,9 @@ namespace std
struct __copy_backward_dispatch struct __copy_backward_dispatch
{ {
static _BidirectionalIterator2 static _BidirectionalIterator2
copy(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last, copy(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
_BidirectionalIterator2 __result) _BidirectionalIterator2 __result)
{ return std::__copy_backward(__first, __last, __result, { return std::__copy_backward(__first, __last, __result,
std::__iterator_category(__first)); } std::__iterator_category(__first)); }
}; };
...@@ -427,8 +427,8 @@ namespace std ...@@ -427,8 +427,8 @@ namespace std
typedef typename __type_traits<typename iterator_traits<_BI2>::value_type> typedef typename __type_traits<typename iterator_traits<_BI2>::value_type>
::has_trivial_assignment_operator _Trivial; ::has_trivial_assignment_operator _Trivial;
return return
std::__copy_backward_dispatch<_BI1, _BI2, _Trivial>::copy(__first, std::__copy_backward_dispatch<_BI1, _BI2, _Trivial>::copy(__first,
__last, __last,
__result); __result);
} }
...@@ -754,7 +754,7 @@ namespace std ...@@ -754,7 +754,7 @@ namespace std
__glibcxx_requires_valid_range(__first1, __last1); __glibcxx_requires_valid_range(__first1, __last1);
__glibcxx_requires_valid_range(__first2, __last2); __glibcxx_requires_valid_range(__first2, __last2);
for (;__first1 != __last1 && __first2 != __last2; ++__first1, ++__first2) for (;__first1 != __last1 && __first2 != __last2; ++__first1, ++__first2)
{ {
if (*__first1 < *__first2) if (*__first1 < *__first2)
return true; return true;
...@@ -790,7 +790,7 @@ namespace std ...@@ -790,7 +790,7 @@ namespace std
__glibcxx_requires_valid_range(__first2, __last2); __glibcxx_requires_valid_range(__first2, __last2);
for ( ; __first1 != __last1 && __first2 != __last2 for ( ; __first1 != __last1 && __first2 != __last2
; ++__first1, ++__first2) ; ++__first1, ++__first2)
{ {
if (__comp(*__first1, *__first2)) if (__comp(*__first1, *__first2))
return true; return true;
...@@ -800,10 +800,10 @@ namespace std ...@@ -800,10 +800,10 @@ namespace std
return __first1 == __last1 && __first2 != __last2; return __first1 == __last1 && __first2 != __last2;
} }
inline bool inline bool
lexicographical_compare(const unsigned char* __first1, lexicographical_compare(const unsigned char* __first1,
const unsigned char* __last1, const unsigned char* __last1,
const unsigned char* __first2, const unsigned char* __first2,
const unsigned char* __last2) const unsigned char* __last2)
{ {
__glibcxx_requires_valid_range(__first1, __last1); __glibcxx_requires_valid_range(__first1, __last1);
...@@ -838,4 +838,4 @@ namespace std ...@@ -838,4 +838,4 @@ namespace std
} // namespace std } // namespace std
#endif #endif
...@@ -78,9 +78,9 @@ namespace std ...@@ -78,9 +78,9 @@ namespace std
{ {
// _GLIBCXX_RESOLVE_LIB_DEFECTS // _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(__value); ::new(static_cast<void*>(__p)) _T1(__value);
} }
/** /**
* @if maint * @if maint
* Constructs an object in existing memory by invoking an allocated * Constructs an object in existing memory by invoking an allocated
...@@ -92,7 +92,7 @@ namespace std ...@@ -92,7 +92,7 @@ namespace std
_Construct(_T1* __p) _Construct(_T1* __p)
{ {
// _GLIBCXX_RESOLVE_LIB_DEFECTS // _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(); ::new(static_cast<void*>(__p)) _T1();
} }
...@@ -108,7 +108,7 @@ namespace std ...@@ -108,7 +108,7 @@ namespace std
/** /**
* @if maint * @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(). * This is a helper function used only by _Destroy().
* @endif * @endif
...@@ -128,7 +128,7 @@ namespace std ...@@ -128,7 +128,7 @@ namespace std
* This is a helper function used only by _Destroy(). * This is a helper function used only by _Destroy().
* @endif * @endif
*/ */
template<typename _ForwardIterator> template<typename _ForwardIterator>
inline void inline void
__destroy_aux(_ForwardIterator, _ForwardIterator, __true_type) __destroy_aux(_ForwardIterator, _ForwardIterator, __true_type)
{ } { }
......
...@@ -74,7 +74,7 @@ namespace std ...@@ -74,7 +74,7 @@ namespace std
_Distance __parent = 0; _Distance __parent = 0;
for (_Distance __child = 1; __child < __n; ++__child) for (_Distance __child = 1; __child < __n; ++__child)
{ {
if (__first[__parent] < __first[__child]) if (__first[__parent] < __first[__child])
return false; return false;
if ((__child & 1) == 0) if ((__child & 1) == 0)
++__parent; ++__parent;
...@@ -113,7 +113,7 @@ namespace std ...@@ -113,7 +113,7 @@ namespace std
// Heap-manipulation functions: push_heap, pop_heap, make_heap, sort_heap. // Heap-manipulation functions: push_heap, pop_heap, make_heap, sort_heap.
template<typename _RandomAccessIterator, typename _Distance, typename _Tp> template<typename _RandomAccessIterator, typename _Distance, typename _Tp>
void void
__push_heap(_RandomAccessIterator __first, __push_heap(_RandomAccessIterator __first,
_Distance __holeIndex, _Distance __topIndex, _Tp __value) _Distance __holeIndex, _Distance __topIndex, _Tp __value)
{ {
...@@ -137,7 +137,7 @@ namespace std ...@@ -137,7 +137,7 @@ namespace std
* range [first,last-1). After completion, [first,last) is a valid heap. * range [first,last-1). After completion, [first,last) is a valid heap.
*/ */
template<typename _RandomAccessIterator> template<typename _RandomAccessIterator>
inline void inline void
push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
{ {
typedef typename iterator_traits<_RandomAccessIterator>::value_type typedef typename iterator_traits<_RandomAccessIterator>::value_type
...@@ -156,7 +156,7 @@ namespace std ...@@ -156,7 +156,7 @@ namespace std
_DistanceType(0), _ValueType(*(__last - 1))); _DistanceType(0), _ValueType(*(__last - 1)));
} }
template<typename _RandomAccessIterator, typename _Distance, typename _Tp, template<typename _RandomAccessIterator, typename _Distance, typename _Tp,
typename _Compare> typename _Compare>
void void
__push_heap(_RandomAccessIterator __first, _Distance __holeIndex, __push_heap(_RandomAccessIterator __first, _Distance __holeIndex,
...@@ -185,7 +185,7 @@ namespace std ...@@ -185,7 +185,7 @@ namespace std
* Compare operations are performed using comp. * Compare operations are performed using comp.
*/ */
template<typename _RandomAccessIterator, typename _Compare> template<typename _RandomAccessIterator, typename _Compare>
inline void inline void
push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Compare __comp) _Compare __comp)
{ {
...@@ -205,7 +205,7 @@ namespace std ...@@ -205,7 +205,7 @@ namespace std
} }
template<typename _RandomAccessIterator, typename _Distance, typename _Tp> template<typename _RandomAccessIterator, typename _Distance, typename _Tp>
void void
__adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex, __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex,
_Distance __len, _Tp __value) _Distance __len, _Tp __value)
{ {
...@@ -228,7 +228,7 @@ namespace std ...@@ -228,7 +228,7 @@ namespace std
} }
template<typename _RandomAccessIterator, typename _Tp> template<typename _RandomAccessIterator, typename _Tp>
inline void inline void
__pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
_RandomAccessIterator __result, _Tp __value) _RandomAccessIterator __result, _Tp __value)
{ {
...@@ -292,7 +292,7 @@ namespace std ...@@ -292,7 +292,7 @@ namespace std
} }
template<typename _RandomAccessIterator, typename _Tp, typename _Compare> template<typename _RandomAccessIterator, typename _Tp, typename _Compare>
inline void inline void
__pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
_RandomAccessIterator __result, _Tp __value, _Compare __comp) _RandomAccessIterator __result, _Tp __value, _Compare __comp)
{ {
...@@ -315,7 +315,7 @@ namespace std ...@@ -315,7 +315,7 @@ namespace std
* made using comp. * made using comp.
*/ */
template<typename _RandomAccessIterator, typename _Compare> template<typename _RandomAccessIterator, typename _Compare>
inline void inline void
pop_heap(_RandomAccessIterator __first, pop_heap(_RandomAccessIterator __first,
_RandomAccessIterator __last, _Compare __comp) _RandomAccessIterator __last, _Compare __comp)
{ {
...@@ -340,7 +340,7 @@ namespace std ...@@ -340,7 +340,7 @@ namespace std
* This operation makes the elements in [first,last) into a heap. * This operation makes the elements in [first,last) into a heap.
*/ */
template<typename _RandomAccessIterator> template<typename _RandomAccessIterator>
void void
make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
{ {
typedef typename iterator_traits<_RandomAccessIterator>::value_type typedef typename iterator_traits<_RandomAccessIterator>::value_type
...@@ -357,7 +357,7 @@ namespace std ...@@ -357,7 +357,7 @@ namespace std
if (__last - __first < 2) if (__last - __first < 2)
return; return;
const _DistanceType __len = __last - __first; const _DistanceType __len = __last - __first;
_DistanceType __parent = (__len - 2) / 2; _DistanceType __parent = (__len - 2) / 2;
while (true) while (true)
{ {
...@@ -380,7 +380,7 @@ namespace std ...@@ -380,7 +380,7 @@ namespace std
* Comparisons are made using comp. * Comparisons are made using comp.
*/ */
template<typename _RandomAccessIterator, typename _Compare> template<typename _RandomAccessIterator, typename _Compare>
inline void inline void
make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Compare __comp) _Compare __comp)
{ {
...@@ -393,7 +393,7 @@ namespace std ...@@ -393,7 +393,7 @@ namespace std
__glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>) _RandomAccessIterator>)
__glibcxx_requires_valid_range(__first, __last); __glibcxx_requires_valid_range(__first, __last);
if (__last - __first < 2) if (__last - __first < 2)
return; return;
...@@ -444,7 +444,7 @@ namespace std ...@@ -444,7 +444,7 @@ namespace std
* Comparisons are made using comp. * Comparisons are made using comp.
*/ */
template<typename _RandomAccessIterator, typename _Compare> template<typename _RandomAccessIterator, typename _Compare>
void void
sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Compare __comp) _Compare __comp)
{ {
......
...@@ -76,7 +76,7 @@ namespace std ...@@ -76,7 +76,7 @@ namespace std
{ {
// concept requirements // concept requirements
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
typename iterator_traits<_InputIterator>::difference_type __n = 0; typename iterator_traits<_InputIterator>::difference_type __n = 0;
while (__first != __last) while (__first != __last)
{ {
...@@ -85,7 +85,7 @@ namespace std ...@@ -85,7 +85,7 @@ namespace std
} }
return __n; return __n;
} }
template<typename _RandomAccessIterator> template<typename _RandomAccessIterator>
inline typename iterator_traits<_RandomAccessIterator>::difference_type inline typename iterator_traits<_RandomAccessIterator>::difference_type
__distance(_RandomAccessIterator __first, _RandomAccessIterator __last, __distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
...@@ -96,7 +96,7 @@ namespace std ...@@ -96,7 +96,7 @@ namespace std
_RandomAccessIterator>) _RandomAccessIterator>)
return __last - __first; return __last - __first;
} }
/** /**
* @brief A generalization of pointer arithmetic. * @brief A generalization of pointer arithmetic.
* @param first An input iterator. * @param first An input iterator.
...@@ -117,7 +117,7 @@ namespace std ...@@ -117,7 +117,7 @@ namespace std
return std::__distance(__first, __last, return std::__distance(__first, __last,
std::__iterator_category(__first)); std::__iterator_category(__first));
} }
template<typename _InputIterator, typename _Distance> template<typename _InputIterator, typename _Distance>
inline void inline void
__advance(_InputIterator& __i, _Distance __n, input_iterator_tag) __advance(_InputIterator& __i, _Distance __n, input_iterator_tag)
...@@ -127,7 +127,7 @@ namespace std ...@@ -127,7 +127,7 @@ namespace std
while (__n--) while (__n--)
++__i; ++__i;
} }
template<typename _BidirectionalIterator, typename _Distance> template<typename _BidirectionalIterator, typename _Distance>
inline void inline void
__advance(_BidirectionalIterator& __i, _Distance __n, __advance(_BidirectionalIterator& __i, _Distance __n,
...@@ -143,7 +143,7 @@ namespace std ...@@ -143,7 +143,7 @@ namespace std
while (__n++) while (__n++)
--__i; --__i;
} }
template<typename _RandomAccessIterator, typename _Distance> template<typename _RandomAccessIterator, typename _Distance>
inline void inline void
__advance(_RandomAccessIterator& __i, _Distance __n, __advance(_RandomAccessIterator& __i, _Distance __n,
...@@ -154,7 +154,7 @@ namespace std ...@@ -154,7 +154,7 @@ namespace std
_RandomAccessIterator>) _RandomAccessIterator>)
__i += __n; __i += __n;
} }
/** /**
* @brief A generalization of pointer arithmetic. * @brief A generalization of pointer arithmetic.
* @param i An input iterator. * @param i An input iterator.
......
...@@ -73,12 +73,12 @@ namespace __gnu_norm ...@@ -73,12 +73,12 @@ namespace __gnu_norm
template <class _Key, class _Compare, class _Alloc> template <class _Key, class _Compare, class _Alloc>
inline bool inline bool
operator==(const multiset<_Key,_Compare,_Alloc>& __x, operator==(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y); const multiset<_Key,_Compare,_Alloc>& __y);
template <class _Key, class _Compare, class _Alloc> template <class _Key, class _Compare, class _Alloc>
inline bool inline bool
operator<(const multiset<_Key,_Compare,_Alloc>& __x, operator<(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y); const multiset<_Key,_Compare,_Alloc>& __y);
/** /**
...@@ -108,17 +108,17 @@ namespace __gnu_norm ...@@ -108,17 +108,17 @@ namespace __gnu_norm
__glibcxx_class_requires(_Key, _SGIAssignableConcept) __glibcxx_class_requires(_Key, _SGIAssignableConcept)
__glibcxx_class_requires4(_Compare, bool, _Key, _Key, __glibcxx_class_requires4(_Compare, bool, _Key, _Key,
_BinaryFunctionConcept) _BinaryFunctionConcept)
public: public:
// typedefs: // typedefs:
typedef _Key key_type; typedef _Key key_type;
typedef _Key value_type; typedef _Key value_type;
typedef _Compare key_compare; typedef _Compare key_compare;
typedef _Compare value_compare; typedef _Compare value_compare;
private: private:
/// @if maint This turns a red-black tree into a [multi]set. @endif /// @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; _Identity<value_type>, key_compare, _Alloc> _Rep_type;
/// @if maint The actual tree structure. @endif /// @if maint The actual tree structure. @endif
_Rep_type _M_t; _Rep_type _M_t;
...@@ -137,7 +137,7 @@ namespace __gnu_norm ...@@ -137,7 +137,7 @@ namespace __gnu_norm
typedef typename _Rep_type::allocator_type allocator_type; typedef typename _Rep_type::allocator_type allocator_type;
// allocation/deallocation // allocation/deallocation
/** /**
* @brief Default constructor creates no elements. * @brief Default constructor creates no elements.
*/ */
...@@ -201,12 +201,12 @@ namespace __gnu_norm ...@@ -201,12 +201,12 @@ namespace __gnu_norm
multiset<_Key,_Compare,_Alloc>& multiset<_Key,_Compare,_Alloc>&
operator=(const multiset<_Key,_Compare,_Alloc>& __x) operator=(const multiset<_Key,_Compare,_Alloc>& __x)
{ {
_M_t = __x._M_t; _M_t = __x._M_t;
return *this; return *this;
} }
// accessors: // accessors:
/// Returns the comparison object. /// Returns the comparison object.
key_compare key_compare
key_comp() const key_comp() const
...@@ -219,7 +219,7 @@ namespace __gnu_norm ...@@ -219,7 +219,7 @@ namespace __gnu_norm
allocator_type allocator_type
get_allocator() const get_allocator() const
{ return _M_t.get_allocator(); } { return _M_t.get_allocator(); }
/** /**
* Returns a read/write iterator that points to the first element in the * Returns a read/write iterator that points to the first element in the
* %multiset. Iteration is done in ascending order according to the * %multiset. Iteration is done in ascending order according to the
...@@ -237,7 +237,7 @@ namespace __gnu_norm ...@@ -237,7 +237,7 @@ namespace __gnu_norm
iterator iterator
end() const end() const
{ return _M_t.end(); } { return _M_t.end(); }
/** /**
* Returns a read/write reverse iterator that points to the last element * Returns a read/write reverse iterator that points to the last element
* in the %multiset. Iteration is done in descending order according to * in the %multiset. Iteration is done in descending order according to
...@@ -245,8 +245,8 @@ namespace __gnu_norm ...@@ -245,8 +245,8 @@ namespace __gnu_norm
*/ */
reverse_iterator reverse_iterator
rbegin() const rbegin() const
{ return _M_t.rbegin(); } { return _M_t.rbegin(); }
/** /**
* Returns a read/write reverse iterator that points to the last element * Returns a read/write reverse iterator that points to the last element
* in the %multiset. Iteration is done in descending order according to * in the %multiset. Iteration is done in descending order according to
...@@ -255,22 +255,22 @@ namespace __gnu_norm ...@@ -255,22 +255,22 @@ namespace __gnu_norm
reverse_iterator reverse_iterator
rend() const rend() const
{ return _M_t.rend(); } { return _M_t.rend(); }
/// Returns true if the %set is empty. /// Returns true if the %set is empty.
bool bool
empty() const empty() const
{ return _M_t.empty(); } { return _M_t.empty(); }
/// Returns the size of the %set. /// Returns the size of the %set.
size_type size_type
size() const size() const
{ return _M_t.size(); } { return _M_t.size(); }
/// Returns the maximum size of the %set. /// Returns the maximum size of the %set.
size_type size_type
max_size() const max_size() const
{ return _M_t.max_size(); } { return _M_t.max_size(); }
/** /**
* @brief Swaps data with another %multiset. * @brief Swaps data with another %multiset.
* @param x A %multiset of the same element and allocator types. * @param x A %multiset of the same element and allocator types.
...@@ -285,7 +285,7 @@ namespace __gnu_norm ...@@ -285,7 +285,7 @@ namespace __gnu_norm
void void
swap(multiset<_Key,_Compare,_Alloc>& __x) swap(multiset<_Key,_Compare,_Alloc>& __x)
{ _M_t.swap(__x._M_t); } { _M_t.swap(__x._M_t); }
// insert/erase // insert/erase
/** /**
* @brief Inserts an element into the %multiset. * @brief Inserts an element into the %multiset.
...@@ -301,7 +301,7 @@ namespace __gnu_norm ...@@ -301,7 +301,7 @@ namespace __gnu_norm
iterator iterator
insert(const value_type& __x) insert(const value_type& __x)
{ return _M_t.insert_equal(__x); } { return _M_t.insert_equal(__x); }
/** /**
* @brief Inserts an element into the %multiset. * @brief Inserts an element into the %multiset.
* @param position An iterator that serves as a hint as to where the * @param position An iterator that serves as a hint as to where the
...@@ -354,11 +354,11 @@ namespace __gnu_norm ...@@ -354,11 +354,11 @@ namespace __gnu_norm
*/ */
void void
erase(iterator __position) erase(iterator __position)
{ {
typedef typename _Rep_type::iterator _Rep_iterator; 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. * @brief Erases elements according to the provided key.
* @param x Key of element to be erased. * @param x Key of element to be erased.
...@@ -373,7 +373,7 @@ namespace __gnu_norm ...@@ -373,7 +373,7 @@ namespace __gnu_norm
size_type size_type
erase(const key_type& __x) erase(const key_type& __x)
{ return _M_t.erase(__x); } { return _M_t.erase(__x); }
/** /**
* @brief Erases a [first,last) range of elements from a %multiset. * @brief Erases a [first,last) range of elements from a %multiset.
* @param first Iterator pointing to the start of the range to be * @param first Iterator pointing to the start of the range to be
...@@ -387,11 +387,11 @@ namespace __gnu_norm ...@@ -387,11 +387,11 @@ namespace __gnu_norm
*/ */
void void
erase(iterator __first, iterator __last) erase(iterator __first, iterator __last)
{ {
typedef typename _Rep_type::iterator _Rep_iterator; 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 all elements in a %multiset. Note that this function only
* erases the elements, and that if the elements themselves are pointers, * erases the elements, and that if the elements themselves are pointers,
...@@ -401,9 +401,9 @@ namespace __gnu_norm ...@@ -401,9 +401,9 @@ namespace __gnu_norm
void void
clear() clear()
{ _M_t.clear(); } { _M_t.clear(); }
// multiset operations: // multiset operations:
/** /**
* @brief Finds the number of elements with given key. * @brief Finds the number of elements with given key.
* @param x Key of elements to be located. * @param x Key of elements to be located.
...@@ -412,7 +412,7 @@ namespace __gnu_norm ...@@ -412,7 +412,7 @@ namespace __gnu_norm
size_type size_type
count(const key_type& __x) const count(const key_type& __x) const
{ return _M_t.count(__x); } { return _M_t.count(__x); }
// _GLIBCXX_RESOLVE_LIB_DEFECTS // _GLIBCXX_RESOLVE_LIB_DEFECTS
// 214. set::find() missing const overload // 214. set::find() missing const overload
//@{ //@{
...@@ -430,12 +430,12 @@ namespace __gnu_norm ...@@ -430,12 +430,12 @@ namespace __gnu_norm
iterator iterator
find(const key_type& __x) find(const key_type& __x)
{ return _M_t.find(__x); } { return _M_t.find(__x); }
const_iterator const_iterator
find(const key_type& __x) const find(const key_type& __x) const
{ return _M_t.find(__x); } { return _M_t.find(__x); }
//@} //@}
//@{ //@{
/** /**
* @brief Finds the beginning of a subsequence matching given key. * @brief Finds the beginning of a subsequence matching given key.
...@@ -451,12 +451,12 @@ namespace __gnu_norm ...@@ -451,12 +451,12 @@ namespace __gnu_norm
iterator iterator
lower_bound(const key_type& __x) lower_bound(const key_type& __x)
{ return _M_t.lower_bound(__x); } { return _M_t.lower_bound(__x); }
const_iterator const_iterator
lower_bound(const key_type& __x) const lower_bound(const key_type& __x) const
{ return _M_t.lower_bound(__x); } { return _M_t.lower_bound(__x); }
//@} //@}
//@{ //@{
/** /**
* @brief Finds the end of a subsequence matching given key. * @brief Finds the end of a subsequence matching given key.
...@@ -467,12 +467,12 @@ namespace __gnu_norm ...@@ -467,12 +467,12 @@ namespace __gnu_norm
iterator iterator
upper_bound(const key_type& __x) upper_bound(const key_type& __x)
{ return _M_t.upper_bound(__x); } { return _M_t.upper_bound(__x); }
const_iterator const_iterator
upper_bound(const key_type& __x) const upper_bound(const key_type& __x) const
{ return _M_t.upper_bound(__x); } { return _M_t.upper_bound(__x); }
//@} //@}
//@{ //@{
/** /**
* @brief Finds a subsequence matching given key. * @brief Finds a subsequence matching given key.
...@@ -492,11 +492,11 @@ namespace __gnu_norm ...@@ -492,11 +492,11 @@ namespace __gnu_norm
pair<iterator,iterator> pair<iterator,iterator>
equal_range(const key_type& __x) equal_range(const key_type& __x)
{ return _M_t.equal_range(__x); } { return _M_t.equal_range(__x); }
pair<const_iterator,const_iterator> pair<const_iterator,const_iterator>
equal_range(const key_type& __x) const equal_range(const key_type& __x) const
{ return _M_t.equal_range(__x); } { return _M_t.equal_range(__x); }
template <class _K1, class _C1, class _A1> template <class _K1, class _C1, class _A1>
friend bool friend bool
operator== (const multiset<_K1,_C1,_A1>&, operator== (const multiset<_K1,_C1,_A1>&,
...@@ -521,10 +521,10 @@ namespace __gnu_norm ...@@ -521,10 +521,10 @@ namespace __gnu_norm
*/ */
template <class _Key, class _Compare, class _Alloc> template <class _Key, class _Compare, class _Alloc>
inline bool inline bool
operator==(const multiset<_Key,_Compare,_Alloc>& __x, operator==(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y) const multiset<_Key,_Compare,_Alloc>& __y)
{ return __x._M_t == __y._M_t; } { return __x._M_t == __y._M_t; }
/** /**
* @brief Multiset ordering relation. * @brief Multiset ordering relation.
* @param x A %multiset. * @param x A %multiset.
...@@ -538,42 +538,42 @@ namespace __gnu_norm ...@@ -538,42 +538,42 @@ namespace __gnu_norm
*/ */
template <class _Key, class _Compare, class _Alloc> template <class _Key, class _Compare, class _Alloc>
inline bool inline bool
operator<(const multiset<_Key,_Compare,_Alloc>& __x, operator<(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y) const multiset<_Key,_Compare,_Alloc>& __y)
{ return __x._M_t < __y._M_t; } { return __x._M_t < __y._M_t; }
/// Returns !(x == y). /// Returns !(x == y).
template <class _Key, class _Compare, class _Alloc> template <class _Key, class _Compare, class _Alloc>
inline bool inline bool
operator!=(const multiset<_Key,_Compare,_Alloc>& __x, operator!=(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y) const multiset<_Key,_Compare,_Alloc>& __y)
{ return !(__x == __y); } { return !(__x == __y); }
/// Returns y < x. /// Returns y < x.
template <class _Key, class _Compare, class _Alloc> template <class _Key, class _Compare, class _Alloc>
inline bool inline bool
operator>(const multiset<_Key,_Compare,_Alloc>& __x, operator>(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y) const multiset<_Key,_Compare,_Alloc>& __y)
{ return __y < __x; } { return __y < __x; }
/// Returns !(y < x) /// Returns !(y < x)
template <class _Key, class _Compare, class _Alloc> template <class _Key, class _Compare, class _Alloc>
inline bool inline bool
operator<=(const multiset<_Key,_Compare,_Alloc>& __x, operator<=(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y) const multiset<_Key,_Compare,_Alloc>& __y)
{ return !(__y < __x); } { return !(__y < __x); }
/// Returns !(x < y) /// Returns !(x < y)
template <class _Key, class _Compare, class _Alloc> template <class _Key, class _Compare, class _Alloc>
inline bool inline bool
operator>=(const multiset<_Key,_Compare,_Alloc>& __x, operator>=(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y) const multiset<_Key,_Compare,_Alloc>& __y)
{ return !(__x < __y); } { return !(__x < __y); }
/// See std::multiset::swap(). /// See std::multiset::swap().
template <class _Key, class _Compare, class _Alloc> template <class _Key, class _Compare, class _Alloc>
inline void inline void
swap(multiset<_Key,_Compare,_Alloc>& __x, swap(multiset<_Key,_Compare,_Alloc>& __x,
multiset<_Key,_Compare,_Alloc>& __y) multiset<_Key,_Compare,_Alloc>& __y)
{ __x.swap(__y); } { __x.swap(__y); }
......
...@@ -166,7 +166,7 @@ namespace std ...@@ -166,7 +166,7 @@ namespace std
typename _BinaryOperation1, typename _BinaryOperation2> typename _BinaryOperation1, typename _BinaryOperation2>
_Tp _Tp
inner_product(_InputIterator1 __first1, _InputIterator1 __last1, inner_product(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _Tp __init, _InputIterator2 __first2, _Tp __init,
_BinaryOperation1 __binary_op1, _BinaryOperation1 __binary_op1,
_BinaryOperation2 __binary_op2) _BinaryOperation2 __binary_op2)
{ {
...@@ -195,7 +195,7 @@ namespace std ...@@ -195,7 +195,7 @@ namespace std
* @return Iterator pointing just beyond the values written to result. * @return Iterator pointing just beyond the values written to result.
*/ */
template<typename _InputIterator, typename _OutputIterator> template<typename _InputIterator, typename _OutputIterator>
_OutputIterator _OutputIterator
partial_sum(_InputIterator __first, _InputIterator __last, partial_sum(_InputIterator __first, _InputIterator __last,
_OutputIterator __result) _OutputIterator __result)
{ {
...@@ -231,7 +231,7 @@ namespace std ...@@ -231,7 +231,7 @@ namespace std
* @return Iterator pointing just beyond the values written to result. * @return Iterator pointing just beyond the values written to result.
*/ */
template<typename _InputIterator, typename _OutputIterator, typename _BinaryOperation> template<typename _InputIterator, typename _OutputIterator, typename _BinaryOperation>
_OutputIterator _OutputIterator
partial_sum(_InputIterator __first, _InputIterator __last, partial_sum(_InputIterator __first, _InputIterator __last,
_OutputIterator __result, _BinaryOperation __binary_op) _OutputIterator __result, _BinaryOperation __binary_op)
{ {
...@@ -299,7 +299,7 @@ namespace std ...@@ -299,7 +299,7 @@ namespace std
* @return Iterator pointing just beyond the values written to result. * @return Iterator pointing just beyond the values written to result.
*/ */
template<typename _InputIterator, typename _OutputIterator, typename _BinaryOperation> template<typename _InputIterator, typename _OutputIterator, typename _BinaryOperation>
_OutputIterator _OutputIterator
adjacent_difference(_InputIterator __first, _InputIterator __last, adjacent_difference(_InputIterator __first, _InputIterator __last,
_OutputIterator __result, _BinaryOperation __binary_op) _OutputIterator __result, _BinaryOperation __binary_op)
{ {
......
...@@ -145,7 +145,7 @@ namespace std ...@@ -145,7 +145,7 @@ namespace std
inline pair<_T1, _T2> inline pair<_T1, _T2>
make_pair(_T1 __x, _T2 __y) make_pair(_T1 __x, _T2 __y)
{ return pair<_T1, _T2>(__x, __y); } { return pair<_T1, _T2>(__x, __y); }
} // namespace std } // namespace std
#endif /* _PAIR_H */ #endif /* _PAIR_H */
......
...@@ -69,15 +69,15 @@ namespace std ...@@ -69,15 +69,15 @@ namespace std
// Forward declarations of operators < and ==, needed for friend declaration. // Forward declarations of operators < and ==, needed for friend declaration.
template<typename _Tp, typename _Sequence = deque<_Tp> > template<typename _Tp, typename _Sequence = deque<_Tp> >
class queue; class queue;
template<typename _Tp, typename _Seq> template<typename _Tp, typename _Seq>
inline bool inline bool
operator==(const queue<_Tp,_Seq>&, const queue<_Tp,_Seq>&); operator==(const queue<_Tp,_Seq>&, const queue<_Tp,_Seq>&);
template<typename _Tp, typename _Seq> template<typename _Tp, typename _Seq>
inline bool inline bool
operator<(const queue<_Tp,_Seq>&, const queue<_Tp,_Seq>&); operator<(const queue<_Tp,_Seq>&, const queue<_Tp,_Seq>&);
/** /**
* @brief A standard container giving FIFO behavior. * @brief A standard container giving FIFO behavior.
* *
...@@ -111,22 +111,22 @@ namespace std ...@@ -111,22 +111,22 @@ namespace std
__glibcxx_class_requires(_Sequence, _FrontInsertionSequenceConcept) __glibcxx_class_requires(_Sequence, _FrontInsertionSequenceConcept)
__glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept) __glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept)
__glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept) __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept)
template<typename _Tp1, typename _Seq1> template<typename _Tp1, typename _Seq1>
friend bool friend bool
operator==(const queue<_Tp1, _Seq1>&, const queue<_Tp1, _Seq1>&); operator==(const queue<_Tp1, _Seq1>&, const queue<_Tp1, _Seq1>&);
template<typename _Tp1, typename _Seq1> template<typename _Tp1, typename _Seq1>
friend bool friend bool
operator<(const queue<_Tp1, _Seq1>&, const queue<_Tp1, _Seq1>&); operator<(const queue<_Tp1, _Seq1>&, const queue<_Tp1, _Seq1>&);
public: public:
typedef typename _Sequence::value_type value_type; typedef typename _Sequence::value_type value_type;
typedef typename _Sequence::reference reference; typedef typename _Sequence::reference reference;
typedef typename _Sequence::const_reference const_reference; typedef typename _Sequence::const_reference const_reference;
typedef typename _Sequence::size_type size_type; typedef typename _Sequence::size_type size_type;
typedef _Sequence container_type; typedef _Sequence container_type;
protected: protected:
/** /**
* 'c' is the underlying container. Maintainers wondering why * 'c' is the underlying container. Maintainers wondering why
...@@ -137,70 +137,70 @@ namespace std ...@@ -137,70 +137,70 @@ namespace std
* containers allow for derivation. Odd.) * containers allow for derivation. Odd.)
*/ */
_Sequence c; _Sequence c;
public: public:
/** /**
* @brief Default constructor creates no elements. * @brief Default constructor creates no elements.
*/ */
explicit explicit
queue(const _Sequence& __c = _Sequence()) : c(__c) {} queue(const _Sequence& __c = _Sequence()) : c(__c) {}
/** /**
* Returns true if the %queue is empty. * Returns true if the %queue is empty.
*/ */
bool bool
empty() const empty() const
{ return c.empty(); } { return c.empty(); }
/** Returns the number of elements in the %queue. */ /** Returns the number of elements in the %queue. */
size_type size_type
size() const size() const
{ return c.size(); } { return c.size(); }
/** /**
* Returns a read/write reference to the data at the first * Returns a read/write reference to the data at the first
* element of the %queue. * element of the %queue.
*/ */
reference reference
front() front()
{ {
__glibcxx_requires_nonempty(); __glibcxx_requires_nonempty();
return c.front(); return c.front();
} }
/** /**
* Returns a read-only (constant) reference to the data at the first * Returns a read-only (constant) reference to the data at the first
* element of the %queue. * element of the %queue.
*/ */
const_reference const_reference
front() const front() const
{ {
__glibcxx_requires_nonempty(); __glibcxx_requires_nonempty();
return c.front(); return c.front();
} }
/** /**
* Returns a read/write reference to the data at the last * Returns a read/write reference to the data at the last
* element of the %queue. * element of the %queue.
*/ */
reference reference
back() back()
{ {
__glibcxx_requires_nonempty(); __glibcxx_requires_nonempty();
return c.back(); return c.back();
} }
/** /**
* Returns a read-only (constant) reference to the data at the last * Returns a read-only (constant) reference to the data at the last
* element of the %queue. * element of the %queue.
*/ */
const_reference const_reference
back() const back() const
{ {
__glibcxx_requires_nonempty(); __glibcxx_requires_nonempty();
return c.back(); return c.back();
} }
/** /**
* @brief Add data to the end of the %queue. * @brief Add data to the end of the %queue.
* @param x Data to be added. * @param x Data to be added.
...@@ -213,7 +213,7 @@ namespace std ...@@ -213,7 +213,7 @@ namespace std
void void
push(const value_type& __x) push(const value_type& __x)
{ c.push_back(__x); } { c.push_back(__x); }
/** /**
* @brief Removes first element. * @brief Removes first element.
* *
...@@ -226,14 +226,14 @@ namespace std ...@@ -226,14 +226,14 @@ namespace std
* called. * called.
*/ */
void void
pop() pop()
{ {
__glibcxx_requires_nonempty(); __glibcxx_requires_nonempty();
c.pop_front(); c.pop_front();
} }
}; };
/** /**
* @brief Queue equality comparison. * @brief Queue equality comparison.
* @param x A %queue. * @param x A %queue.
...@@ -246,11 +246,11 @@ namespace std ...@@ -246,11 +246,11 @@ namespace std
* if their sequences compare equal. * if their sequences compare equal.
*/ */
template<typename _Tp, typename _Sequence> template<typename _Tp, typename _Sequence>
inline bool inline bool
operator==(const queue<_Tp,_Sequence>& __x, operator==(const queue<_Tp,_Sequence>& __x,
const queue<_Tp,_Sequence>& __y) const queue<_Tp,_Sequence>& __y)
{ return __x.c == __y.c; } { return __x.c == __y.c; }
/** /**
* @brief Queue ordering relation. * @brief Queue ordering relation.
* @param x A %queue. * @param x A %queue.
...@@ -268,34 +268,34 @@ namespace std ...@@ -268,34 +268,34 @@ namespace std
inline bool inline bool
operator<(const queue<_Tp,_Sequence>& __x, const queue<_Tp,_Sequence>& __y) operator<(const queue<_Tp,_Sequence>& __x, const queue<_Tp,_Sequence>& __y)
{ return __x.c < __y.c; } { return __x.c < __y.c; }
/// Based on operator== /// Based on operator==
template<typename _Tp, typename _Sequence> template<typename _Tp, typename _Sequence>
inline bool inline bool
operator!=(const queue<_Tp,_Sequence>& __x, operator!=(const queue<_Tp,_Sequence>& __x,
const queue<_Tp,_Sequence>& __y) const queue<_Tp,_Sequence>& __y)
{ return !(__x == __y); } { return !(__x == __y); }
/// Based on operator< /// Based on operator<
template<typename _Tp, typename _Sequence> template<typename _Tp, typename _Sequence>
inline bool inline bool
operator>(const queue<_Tp,_Sequence>& __x, const queue<_Tp,_Sequence>& __y) operator>(const queue<_Tp,_Sequence>& __x, const queue<_Tp,_Sequence>& __y)
{ return __y < __x; } { return __y < __x; }
/// Based on operator< /// Based on operator<
template<typename _Tp, typename _Sequence> template<typename _Tp, typename _Sequence>
inline bool inline bool
operator<=(const queue<_Tp,_Sequence>& __x, operator<=(const queue<_Tp,_Sequence>& __x,
const queue<_Tp,_Sequence>& __y) const queue<_Tp,_Sequence>& __y)
{ return !(__y < __x); } { return !(__y < __x); }
/// Based on operator< /// Based on operator<
template<typename _Tp, typename _Sequence> template<typename _Tp, typename _Sequence>
inline bool inline bool
operator>=(const queue<_Tp,_Sequence>& __x, operator>=(const queue<_Tp,_Sequence>& __x,
const queue<_Tp,_Sequence>& __y) const queue<_Tp,_Sequence>& __y)
{ return !(__x < __y); } { return !(__x < __y); }
/** /**
* @brief A standard container automatically sorting its contents. * @brief A standard container automatically sorting its contents.
* *
...@@ -345,36 +345,36 @@ namespace std ...@@ -345,36 +345,36 @@ namespace std
__glibcxx_class_requires(_Sequence, _RandomAccessContainerConcept) __glibcxx_class_requires(_Sequence, _RandomAccessContainerConcept)
__glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept) __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept)
__glibcxx_class_requires4(_Compare, bool, _Tp,_Tp,_BinaryFunctionConcept) __glibcxx_class_requires4(_Compare, bool, _Tp,_Tp,_BinaryFunctionConcept)
public: public:
typedef typename _Sequence::value_type value_type; typedef typename _Sequence::value_type value_type;
typedef typename _Sequence::reference reference; typedef typename _Sequence::reference reference;
typedef typename _Sequence::const_reference const_reference; typedef typename _Sequence::const_reference const_reference;
typedef typename _Sequence::size_type size_type; typedef typename _Sequence::size_type size_type;
typedef _Sequence container_type; typedef _Sequence container_type;
protected: protected:
// See queue::c for notes on these names. // See queue::c for notes on these names.
_Sequence c; _Sequence c;
_Compare comp; _Compare comp;
public: public:
/** /**
* @brief Default constructor creates no elements. * @brief Default constructor creates no elements.
*/ */
explicit explicit
priority_queue(const _Compare& __x = _Compare(), priority_queue(const _Compare& __x = _Compare(),
const _Sequence& __s = _Sequence()) const _Sequence& __s = _Sequence())
: c(__s), comp(__x) : c(__s), comp(__x)
{ std::make_heap(c.begin(), c.end(), comp); } { std::make_heap(c.begin(), c.end(), comp); }
/** /**
* @brief Builds a %queue from a range. * @brief Builds a %queue from a range.
* @param first An input iterator. * @param first An input iterator.
* @param last An input iterator. * @param last An input iterator.
* @param x A comparison functor describing a strict weak ordering. * @param x A comparison functor describing a strict weak ordering.
* @param s An initial sequence with which to start. * @param s An initial sequence with which to start.
* *
* Begins by copying @a s, inserting a copy of the elements * Begins by copying @a s, inserting a copy of the elements
* from @a [first,last) into the copy of @a s, then ordering * from @a [first,last) into the copy of @a s, then ordering
* the copy according to @a x. * the copy according to @a x.
...@@ -388,33 +388,33 @@ namespace std ...@@ -388,33 +388,33 @@ namespace std
const _Compare& __x = _Compare(), const _Compare& __x = _Compare(),
const _Sequence& __s = _Sequence()) const _Sequence& __s = _Sequence())
: c(__s), comp(__x) : c(__s), comp(__x)
{ {
__glibcxx_requires_valid_range(__first, __last); __glibcxx_requires_valid_range(__first, __last);
c.insert(c.end(), __first, __last); c.insert(c.end(), __first, __last);
std::make_heap(c.begin(), c.end(), comp); std::make_heap(c.begin(), c.end(), comp);
} }
/** /**
* Returns true if the %queue is empty. * Returns true if the %queue is empty.
*/ */
bool bool
empty() const { return c.empty(); } empty() const { return c.empty(); }
/** Returns the number of elements in the %queue. */ /** Returns the number of elements in the %queue. */
size_type size_type
size() const { return c.size(); } size() const { return c.size(); }
/** /**
* Returns a read-only (constant) reference to the data at the first * Returns a read-only (constant) reference to the data at the first
* element of the %queue. * element of the %queue.
*/ */
const_reference const_reference
top() const top() const
{ {
__glibcxx_requires_nonempty(); __glibcxx_requires_nonempty();
return c.front(); return c.front();
} }
/** /**
* @brief Add data to the %queue. * @brief Add data to the %queue.
* @param x Data to be added. * @param x Data to be added.
...@@ -423,21 +423,21 @@ namespace std ...@@ -423,21 +423,21 @@ namespace std
* The time complexity of the operation depends on the underlying * The time complexity of the operation depends on the underlying
* sequence. * sequence.
*/ */
void void
push(const value_type& __x) push(const value_type& __x)
{ {
try try
{ {
c.push_back(__x); c.push_back(__x);
std::push_heap(c.begin(), c.end(), comp); std::push_heap(c.begin(), c.end(), comp);
} }
catch(...) catch(...)
{ {
c.clear(); c.clear();
__throw_exception_again; __throw_exception_again;
} }
} }
/** /**
* @brief Removes first element. * @brief Removes first element.
* *
...@@ -449,11 +449,11 @@ namespace std ...@@ -449,11 +449,11 @@ namespace std
* data is needed, it should be retrieved before pop() is * data is needed, it should be retrieved before pop() is
* called. * called.
*/ */
void void
pop() pop()
{ {
__glibcxx_requires_nonempty(); __glibcxx_requires_nonempty();
try try
{ {
std::pop_heap(c.begin(), c.end(), comp); std::pop_heap(c.begin(), c.end(), comp);
c.pop_back(); c.pop_back();
...@@ -461,11 +461,11 @@ namespace std ...@@ -461,11 +461,11 @@ namespace std
catch(...) catch(...)
{ {
c.clear(); c.clear();
__throw_exception_again; __throw_exception_again;
} }
} }
}; };
// No equality/comparison operators are provided for priority_queue. // No equality/comparison operators are provided for priority_queue.
} // namespace std } // namespace std
......
...@@ -68,36 +68,36 @@ namespace std ...@@ -68,36 +68,36 @@ namespace std
* uninitialized memory. * uninitialized memory.
*/ */
template <class _ForwardIterator, class _Tp> template <class _ForwardIterator, class _Tp>
class raw_storage_iterator class raw_storage_iterator
: public iterator<output_iterator_tag, void, void, void, void> : public iterator<output_iterator_tag, void, void, void, void>
{ {
protected: protected:
_ForwardIterator _M_iter; _ForwardIterator _M_iter;
public: public:
explicit explicit
raw_storage_iterator(_ForwardIterator __x) raw_storage_iterator(_ForwardIterator __x)
: _M_iter(__x) {} : _M_iter(__x) {}
raw_storage_iterator& raw_storage_iterator&
operator*() { return *this; } operator*() { return *this; }
raw_storage_iterator& raw_storage_iterator&
operator=(const _Tp& __element) operator=(const _Tp& __element)
{ {
std::_Construct(&*_M_iter, __element); std::_Construct(&*_M_iter, __element);
return *this; return *this;
} }
raw_storage_iterator<_ForwardIterator, _Tp>& raw_storage_iterator<_ForwardIterator, _Tp>&
operator++() operator++()
{ {
++_M_iter; ++_M_iter;
return *this; return *this;
} }
raw_storage_iterator<_ForwardIterator, _Tp> raw_storage_iterator<_ForwardIterator, _Tp>
operator++(int) operator++(int)
{ {
raw_storage_iterator<_ForwardIterator, _Tp> __tmp = *this; raw_storage_iterator<_ForwardIterator, _Tp> __tmp = *this;
++_M_iter; ++_M_iter;
......
...@@ -78,7 +78,7 @@ namespace std ...@@ -78,7 +78,7 @@ namespace std
/** @namespace std::rel_ops /** @namespace std::rel_ops
* @brief The generated relational operators are sequestered here. * @brief The generated relational operators are sequestered here.
*/ */
/** /**
* @brief Defines @c != for arbitrary types, in terms of @c ==. * @brief Defines @c != for arbitrary types, in terms of @c ==.
* @param x A thing. * @param x A thing.
......
...@@ -66,18 +66,18 @@ ...@@ -66,18 +66,18 @@
namespace __gnu_norm namespace __gnu_norm
{ {
// Forward declarations of operators < and ==, needed for friend declaration. // 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 _Alloc = allocator<_Key> >
class set; class set;
template<class _Key, class _Compare, class _Alloc> template<class _Key, class _Compare, class _Alloc>
inline bool inline bool
operator==(const set<_Key,_Compare,_Alloc>& __x, operator==(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y); const set<_Key,_Compare,_Alloc>& __y);
template<class _Key, class _Compare, class _Alloc> template<class _Key, class _Compare, class _Alloc>
inline bool inline bool
operator<(const set<_Key,_Compare,_Alloc>& __x, operator<(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y); const set<_Key,_Compare,_Alloc>& __y);
/** /**
...@@ -110,7 +110,7 @@ namespace __gnu_norm ...@@ -110,7 +110,7 @@ namespace __gnu_norm
__glibcxx_class_requires(_Key, _SGIAssignableConcept) __glibcxx_class_requires(_Key, _SGIAssignableConcept)
__glibcxx_class_requires4(_Compare, bool, _Key, _Key, __glibcxx_class_requires4(_Compare, bool, _Key, _Key,
_BinaryFunctionConcept) _BinaryFunctionConcept)
public: public:
// typedefs: // typedefs:
//@{ //@{
...@@ -122,7 +122,7 @@ namespace __gnu_norm ...@@ -122,7 +122,7 @@ namespace __gnu_norm
//@} //@}
private: private:
typedef _Rb_tree<key_type, value_type, typedef _Rb_tree<key_type, value_type,
_Identity<value_type>, key_compare, _Alloc> _Rep_type; _Identity<value_type>, key_compare, _Alloc> _Rep_type;
_Rep_type _M_t; // red-black tree representing set _Rep_type _M_t; // red-black tree representing set
public: public:
...@@ -197,7 +197,7 @@ namespace __gnu_norm ...@@ -197,7 +197,7 @@ namespace __gnu_norm
*/ */
set(const set<_Key,_Compare,_Alloc>& __x) set(const set<_Key,_Compare,_Alloc>& __x)
: _M_t(__x._M_t) { } : _M_t(__x._M_t) { }
/** /**
* @brief Set assignment operator. * @brief Set assignment operator.
* @param x A %set of identical element and allocator types. * @param x A %set of identical element and allocator types.
...@@ -207,8 +207,8 @@ namespace __gnu_norm ...@@ -207,8 +207,8 @@ namespace __gnu_norm
*/ */
set<_Key,_Compare,_Alloc>& set<_Key,_Compare,_Alloc>&
operator=(const set<_Key, _Compare, _Alloc>& __x) operator=(const set<_Key, _Compare, _Alloc>& __x)
{ {
_M_t = __x._M_t; _M_t = __x._M_t;
return *this; return *this;
} }
...@@ -250,7 +250,7 @@ namespace __gnu_norm ...@@ -250,7 +250,7 @@ namespace __gnu_norm
*/ */
reverse_iterator reverse_iterator
rbegin() const rbegin() const
{ return _M_t.rbegin(); } { return _M_t.rbegin(); }
/** /**
* Returns a read-only (constant) reverse iterator that points to the * Returns a read-only (constant) reverse iterator that points to the
...@@ -307,7 +307,7 @@ namespace __gnu_norm ...@@ -307,7 +307,7 @@ namespace __gnu_norm
*/ */
pair<iterator,bool> pair<iterator,bool>
insert(const value_type& __x) insert(const value_type& __x)
{ {
pair<typename _Rep_type::iterator, bool> __p = _M_t.insert_unique(__x); pair<typename _Rep_type::iterator, bool> __p = _M_t.insert_unique(__x);
return pair<iterator, bool>(__p.first, __p.second); return pair<iterator, bool>(__p.first, __p.second);
} }
...@@ -350,7 +350,7 @@ namespace __gnu_norm ...@@ -350,7 +350,7 @@ namespace __gnu_norm
void void
insert(_InputIterator __first, _InputIterator __last) insert(_InputIterator __first, _InputIterator __last)
{ _M_t.insert_unique(__first, __last); } { _M_t.insert_unique(__first, __last); }
/** /**
* @brief Erases an element from a %set. * @brief Erases an element from a %set.
* @param position An iterator pointing to the element to be erased. * @param position An iterator pointing to the element to be erased.
...@@ -362,9 +362,9 @@ namespace __gnu_norm ...@@ -362,9 +362,9 @@ namespace __gnu_norm
*/ */
void void
erase(iterator __position) erase(iterator __position)
{ {
typedef typename _Rep_type::iterator _Rep_iterator; 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 ...@@ -396,7 +396,7 @@ namespace __gnu_norm
erase(iterator __first, iterator __last) erase(iterator __first, iterator __last)
{ {
typedef typename _Rep_type::iterator _Rep_iterator; 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 ...@@ -461,7 +461,7 @@ namespace __gnu_norm
iterator iterator
lower_bound(const key_type& __x) lower_bound(const key_type& __x)
{ return _M_t.lower_bound(__x); } { return _M_t.lower_bound(__x); }
const_iterator const_iterator
lower_bound(const key_type& __x) const lower_bound(const key_type& __x) const
{ return _M_t.lower_bound(__x); } { return _M_t.lower_bound(__x); }
...@@ -502,7 +502,7 @@ namespace __gnu_norm ...@@ -502,7 +502,7 @@ namespace __gnu_norm
pair<iterator,iterator> pair<iterator,iterator>
equal_range(const key_type& __x) equal_range(const key_type& __x)
{ return _M_t.equal_range(__x); } { return _M_t.equal_range(__x); }
pair<const_iterator,const_iterator> pair<const_iterator,const_iterator>
equal_range(const key_type& __x) const equal_range(const key_type& __x) const
{ return _M_t.equal_range(__x); } { return _M_t.equal_range(__x); }
...@@ -511,7 +511,7 @@ namespace __gnu_norm ...@@ -511,7 +511,7 @@ namespace __gnu_norm
template<class _K1, class _C1, class _A1> template<class _K1, class _C1, class _A1>
friend bool friend bool
operator== (const set<_K1,_C1,_A1>&, const set<_K1,_C1,_A1>&); operator== (const set<_K1,_C1,_A1>&, const set<_K1,_C1,_A1>&);
template<class _K1, class _C1, class _A1> template<class _K1, class _C1, class _A1>
friend bool friend bool
operator< (const set<_K1,_C1,_A1>&, const set<_K1,_C1,_A1>&); operator< (const set<_K1,_C1,_A1>&, const set<_K1,_C1,_A1>&);
...@@ -530,7 +530,7 @@ namespace __gnu_norm ...@@ -530,7 +530,7 @@ namespace __gnu_norm
*/ */
template<class _Key, class _Compare, class _Alloc> template<class _Key, class _Compare, class _Alloc>
inline bool inline bool
operator==(const set<_Key,_Compare,_Alloc>& __x, operator==(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y) const set<_Key,_Compare,_Alloc>& __y)
{ return __x._M_t == __y._M_t; } { return __x._M_t == __y._M_t; }
...@@ -547,35 +547,35 @@ namespace __gnu_norm ...@@ -547,35 +547,35 @@ namespace __gnu_norm
*/ */
template<class _Key, class _Compare, class _Alloc> template<class _Key, class _Compare, class _Alloc>
inline bool inline bool
operator<(const set<_Key,_Compare,_Alloc>& __x, operator<(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y) const set<_Key,_Compare,_Alloc>& __y)
{ return __x._M_t < __y._M_t; } { return __x._M_t < __y._M_t; }
/// Returns !(x == y). /// Returns !(x == y).
template<class _Key, class _Compare, class _Alloc> template<class _Key, class _Compare, class _Alloc>
inline bool inline bool
operator!=(const set<_Key,_Compare,_Alloc>& __x, operator!=(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y) const set<_Key,_Compare,_Alloc>& __y)
{ return !(__x == __y); } { return !(__x == __y); }
/// Returns y < x. /// Returns y < x.
template<class _Key, class _Compare, class _Alloc> template<class _Key, class _Compare, class _Alloc>
inline bool inline bool
operator>(const set<_Key,_Compare,_Alloc>& __x, operator>(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y) const set<_Key,_Compare,_Alloc>& __y)
{ return __y < __x; } { return __y < __x; }
/// Returns !(y < x) /// Returns !(y < x)
template<class _Key, class _Compare, class _Alloc> template<class _Key, class _Compare, class _Alloc>
inline bool inline bool
operator<=(const set<_Key,_Compare,_Alloc>& __x, operator<=(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y) const set<_Key,_Compare,_Alloc>& __y)
{ return !(__y < __x); } { return !(__y < __x); }
/// Returns !(x < y) /// Returns !(x < y)
template<class _Key, class _Compare, class _Alloc> template<class _Key, class _Compare, class _Alloc>
inline bool inline bool
operator>=(const set<_Key,_Compare,_Alloc>& __x, operator>=(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y) const set<_Key,_Compare,_Alloc>& __y)
{ return !(__x < __y); } { return !(__x < __y); }
......
...@@ -70,15 +70,15 @@ namespace std ...@@ -70,15 +70,15 @@ namespace std
// declaration. // declaration.
template<typename _Tp, typename _Sequence = deque<_Tp> > template<typename _Tp, typename _Sequence = deque<_Tp> >
class stack; class stack;
template<typename _Tp, typename _Seq> template<typename _Tp, typename _Seq>
inline bool inline bool
operator==(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y); operator==(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y);
template<typename _Tp, typename _Seq> template<typename _Tp, typename _Seq>
inline bool inline bool
operator<(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y); operator<(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y);
/** /**
* @brief A standard container giving FILO behavior. * @brief A standard container giving FILO behavior.
* *
...@@ -114,26 +114,26 @@ namespace std ...@@ -114,26 +114,26 @@ namespace std
__glibcxx_class_requires(_Tp, _SGIAssignableConcept) __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
__glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept) __glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept)
__glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept) __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept)
template<typename _Tp1, typename _Seq1> template<typename _Tp1, typename _Seq1>
friend bool friend bool
operator==(const stack<_Tp1, _Seq1>&, const stack<_Tp1, _Seq1>&); operator==(const stack<_Tp1, _Seq1>&, const stack<_Tp1, _Seq1>&);
template<typename _Tp1, typename _Seq1> template<typename _Tp1, typename _Seq1>
friend bool friend bool
operator<(const stack<_Tp1, _Seq1>&, const stack<_Tp1, _Seq1>&); operator<(const stack<_Tp1, _Seq1>&, const stack<_Tp1, _Seq1>&);
public: public:
typedef typename _Sequence::value_type value_type; typedef typename _Sequence::value_type value_type;
typedef typename _Sequence::reference reference; typedef typename _Sequence::reference reference;
typedef typename _Sequence::const_reference const_reference; typedef typename _Sequence::const_reference const_reference;
typedef typename _Sequence::size_type size_type; typedef typename _Sequence::size_type size_type;
typedef _Sequence container_type; typedef _Sequence container_type;
protected: protected:
// See queue::c for notes on this name. // See queue::c for notes on this name.
_Sequence c; _Sequence c;
public: public:
// XXX removed old def ctor, added def arg to this one to match 14882 // XXX removed old def ctor, added def arg to this one to match 14882
/** /**
...@@ -142,41 +142,41 @@ namespace std ...@@ -142,41 +142,41 @@ namespace std
explicit explicit
stack(const _Sequence& __c = _Sequence()) stack(const _Sequence& __c = _Sequence())
: c(__c) {} : c(__c) {}
/** /**
* Returns true if the %stack is empty. * Returns true if the %stack is empty.
*/ */
bool bool
empty() const empty() const
{ return c.empty(); } { return c.empty(); }
/** Returns the number of elements in the %stack. */ /** Returns the number of elements in the %stack. */
size_type size_type
size() const size() const
{ return c.size(); } { return c.size(); }
/** /**
* Returns a read/write reference to the data at the first * Returns a read/write reference to the data at the first
* element of the %stack. * element of the %stack.
*/ */
reference reference
top() top()
{ {
__glibcxx_requires_nonempty(); __glibcxx_requires_nonempty();
return c.back(); return c.back();
} }
/** /**
* Returns a read-only (constant) reference to the data at the first * Returns a read-only (constant) reference to the data at the first
* element of the %stack. * element of the %stack.
*/ */
const_reference const_reference
top() const top() const
{ {
__glibcxx_requires_nonempty(); __glibcxx_requires_nonempty();
return c.back(); return c.back();
} }
/** /**
* @brief Add data to the top of the %stack. * @brief Add data to the top of the %stack.
* @param x Data to be added. * @param x Data to be added.
...@@ -189,7 +189,7 @@ namespace std ...@@ -189,7 +189,7 @@ namespace std
void void
push(const value_type& __x) push(const value_type& __x)
{ c.push_back(__x); } { c.push_back(__x); }
/** /**
* @brief Removes first element. * @brief Removes first element.
* *
...@@ -202,13 +202,13 @@ namespace std ...@@ -202,13 +202,13 @@ namespace std
* called. * called.
*/ */
void void
pop() pop()
{ {
__glibcxx_requires_nonempty(); __glibcxx_requires_nonempty();
c.pop_back(); c.pop_back();
} }
}; };
/** /**
* @brief Stack equality comparison. * @brief Stack equality comparison.
* @param x A %stack. * @param x A %stack.
...@@ -225,7 +225,7 @@ namespace std ...@@ -225,7 +225,7 @@ namespace std
inline bool inline bool
operator==(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y) operator==(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
{ return __x.c == __y.c; } { return __x.c == __y.c; }
/** /**
* @brief Stack ordering relation. * @brief Stack ordering relation.
* @param x A %stack. * @param x A %stack.
...@@ -243,25 +243,25 @@ namespace std ...@@ -243,25 +243,25 @@ namespace std
inline bool inline bool
operator<(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y) operator<(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
{ return __x.c < __y.c; } { return __x.c < __y.c; }
/// Based on operator== /// Based on operator==
template<typename _Tp, typename _Seq> template<typename _Tp, typename _Seq>
inline bool inline bool
operator!=(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y) operator!=(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
{ return !(__x == __y); } { return !(__x == __y); }
/// Based on operator< /// Based on operator<
template<typename _Tp, typename _Seq> template<typename _Tp, typename _Seq>
inline bool inline bool
operator>(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y) operator>(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
{ return __y < __x; } { return __y < __x; }
/// Based on operator< /// Based on operator<
template<typename _Tp, typename _Seq> template<typename _Tp, typename _Seq>
inline bool inline bool
operator<=(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y) operator<=(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
{ return !(__y < __x); } { return !(__y < __x); }
/// Based on operator< /// Based on operator<
template<typename _Tp, typename _Seq> template<typename _Tp, typename _Seq>
inline bool inline bool
......
...@@ -83,52 +83,52 @@ namespace std ...@@ -83,52 +83,52 @@ namespace std
typedef value_type* pointer; typedef value_type* pointer;
typedef pointer iterator; typedef pointer iterator;
typedef ptrdiff_t size_type; typedef ptrdiff_t size_type;
protected: protected:
size_type _M_original_len; size_type _M_original_len;
size_type _M_len; size_type _M_len;
pointer _M_buffer; pointer _M_buffer;
void void
_M_initialize_buffer(const _Tp&, __true_type) { } _M_initialize_buffer(const _Tp&, __true_type) { }
void void
_M_initialize_buffer(const _Tp& val, __false_type) _M_initialize_buffer(const _Tp& val, __false_type)
{ std::uninitialized_fill_n(_M_buffer, _M_len, val); } { std::uninitialized_fill_n(_M_buffer, _M_len, val); }
public: public:
/// As per Table mumble. /// As per Table mumble.
size_type size_type
size() const size() const
{ return _M_len; } { return _M_len; }
/// Returns the size requested by the constructor; may be >size(). /// Returns the size requested by the constructor; may be >size().
size_type size_type
requested_size() const requested_size() const
{ return _M_original_len; } { return _M_original_len; }
/// As per Table mumble. /// As per Table mumble.
iterator iterator
begin() begin()
{ return _M_buffer; } { return _M_buffer; }
/// As per Table mumble. /// As per Table mumble.
iterator iterator
end() end()
{ return _M_buffer + _M_len; } { return _M_buffer + _M_len; }
/** /**
* Constructs a temporary buffer of a size somewhere between * Constructs a temporary buffer of a size somewhere between
* zero and the size of the given range. * zero and the size of the given range.
*/ */
_Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last); _Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last);
~_Temporary_buffer() ~_Temporary_buffer()
{ {
std::_Destroy(_M_buffer, _M_buffer + _M_len); std::_Destroy(_M_buffer, _M_buffer + _M_len);
std::return_temporary_buffer(_M_buffer); std::return_temporary_buffer(_M_buffer);
} }
private: private:
// Disable copy constructor and assignment operator. // Disable copy constructor and assignment operator.
_Temporary_buffer(const _Temporary_buffer&); _Temporary_buffer(const _Temporary_buffer&);
...@@ -136,12 +136,12 @@ namespace std ...@@ -136,12 +136,12 @@ namespace std
void void
operator=(const _Temporary_buffer&); operator=(const _Temporary_buffer&);
}; };
template<typename _ForwardIterator, typename _Tp> template<typename _ForwardIterator, typename _Tp>
_Temporary_buffer<_ForwardIterator, _Tp>:: _Temporary_buffer<_ForwardIterator, _Tp>::
_Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last) _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) _M_len(0), _M_buffer(0)
{ {
// Workaround for a __type_traits bug in the pre-7.3 compiler. // Workaround for a __type_traits bug in the pre-7.3 compiler.
...@@ -158,11 +158,11 @@ namespace std ...@@ -158,11 +158,11 @@ namespace std
_M_initialize_buffer(*__first, _Trivial()); _M_initialize_buffer(*__first, _Trivial());
} }
catch(...) catch(...)
{ {
std::return_temporary_buffer(_M_buffer); std::return_temporary_buffer(_M_buffer);
_M_buffer = 0; _M_buffer = 0;
_M_len = 0; _M_len = 0;
__throw_exception_again; __throw_exception_again;
} }
} }
} // namespace std } // namespace std
......
...@@ -85,8 +85,8 @@ namespace __gnu_cxx ...@@ -85,8 +85,8 @@ namespace __gnu_cxx
#endif #endif
__gthread_mutex_t _M_lock; __gthread_mutex_t _M_lock;
void void
_M_initialize() _M_initialize()
{ {
#ifdef __GTHREAD_MUTEX_INIT #ifdef __GTHREAD_MUTEX_INIT
// There should be no code in this path given the usage rules above. // There should be no code in this path given the usage rules above.
...@@ -97,7 +97,7 @@ namespace __gnu_cxx ...@@ -97,7 +97,7 @@ namespace __gnu_cxx
&& __gthread_active_p()) && __gthread_active_p())
abort (); abort ();
__gthread_mutex_lock(&__gnu_cxx::_GLIBCXX_mutex); __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 // Even though we have a global lock, we use __gthread_once to be
// absolutely certain the _M_lock mutex is only initialized once on // absolutely certain the _M_lock mutex is only initialized once on
...@@ -113,8 +113,8 @@ namespace __gnu_cxx ...@@ -113,8 +113,8 @@ namespace __gnu_cxx
#endif #endif
} }
void void
_M_acquire_lock() _M_acquire_lock()
{ {
#if !defined(__GTHREAD_MUTEX_INIT) && defined(__GTHREAD_MUTEX_INIT_FUNCTION) #if !defined(__GTHREAD_MUTEX_INIT) && defined(__GTHREAD_MUTEX_INIT_FUNCTION)
if (!_M_init_flag) _M_initialize(); if (!_M_init_flag) _M_initialize();
...@@ -122,8 +122,8 @@ namespace __gnu_cxx ...@@ -122,8 +122,8 @@ namespace __gnu_cxx
__gthread_mutex_lock(&_M_lock); __gthread_mutex_lock(&_M_lock);
} }
void void
_M_release_lock() _M_release_lock()
{ {
#if !defined(__GTHREAD_MUTEX_INIT) && defined(__GTHREAD_MUTEX_INIT_FUNCTION) #if !defined(__GTHREAD_MUTEX_INIT) && defined(__GTHREAD_MUTEX_INIT_FUNCTION)
if (!_M_init_flag) _M_initialize(); if (!_M_init_flag) _M_initialize();
...@@ -131,7 +131,7 @@ namespace __gnu_cxx ...@@ -131,7 +131,7 @@ namespace __gnu_cxx
__gthread_mutex_unlock(&_M_lock); __gthread_mutex_unlock(&_M_lock);
} }
}; };
#ifdef __GTHREAD_MUTEX_INIT #ifdef __GTHREAD_MUTEX_INIT
#define __STL_MUTEX_INITIALIZER = { __GTHREAD_MUTEX_INIT } #define __STL_MUTEX_INITIALIZER = { __GTHREAD_MUTEX_INIT }
#elif defined(__GTHREAD_MUTEX_INIT_FUNCTION) #elif defined(__GTHREAD_MUTEX_INIT_FUNCTION)
...@@ -144,4 +144,4 @@ namespace __gnu_cxx ...@@ -144,4 +144,4 @@ namespace __gnu_cxx
#endif #endif
} // namespace __gnu_cxx } // namespace __gnu_cxx
#endif #endif
...@@ -67,20 +67,20 @@ namespace std ...@@ -67,20 +67,20 @@ namespace std
{ {
// uninitialized_copy // uninitialized_copy
template<typename _InputIterator, typename _ForwardIterator> template<typename _InputIterator, typename _ForwardIterator>
inline _ForwardIterator inline _ForwardIterator
__uninitialized_copy_aux(_InputIterator __first, _InputIterator __last, __uninitialized_copy_aux(_InputIterator __first, _InputIterator __last,
_ForwardIterator __result, _ForwardIterator __result,
__true_type) __true_type)
{ return std::copy(__first, __last, __result); } { return std::copy(__first, __last, __result); }
template<typename _InputIterator, typename _ForwardIterator> template<typename _InputIterator, typename _ForwardIterator>
inline _ForwardIterator inline _ForwardIterator
__uninitialized_copy_aux(_InputIterator __first, _InputIterator __last, __uninitialized_copy_aux(_InputIterator __first, _InputIterator __last,
_ForwardIterator __result, _ForwardIterator __result,
__false_type) __false_type)
{ {
_ForwardIterator __cur = __result; _ForwardIterator __cur = __result;
try try
{ {
for ( ; __first != __last; ++__first, ++__cur) for ( ; __first != __last; ++__first, ++__cur)
std::_Construct(&*__cur, *__first); std::_Construct(&*__cur, *__first);
...@@ -89,7 +89,7 @@ namespace std ...@@ -89,7 +89,7 @@ namespace std
catch(...) catch(...)
{ {
std::_Destroy(__result, __cur); std::_Destroy(__result, __cur);
__throw_exception_again; __throw_exception_again;
} }
} }
...@@ -104,7 +104,7 @@ namespace std ...@@ -104,7 +104,7 @@ namespace std
*/ */
template<typename _InputIterator, typename _ForwardIterator> template<typename _InputIterator, typename _ForwardIterator>
inline _ForwardIterator inline _ForwardIterator
uninitialized_copy(_InputIterator __first, _InputIterator __last, uninitialized_copy(_InputIterator __first, _InputIterator __last,
_ForwardIterator __result) _ForwardIterator __result)
{ {
typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
...@@ -120,7 +120,7 @@ namespace std ...@@ -120,7 +120,7 @@ namespace std
return __result + (__last - __first); return __result + (__last - __first);
} }
inline wchar_t* inline wchar_t*
uninitialized_copy(const wchar_t* __first, const wchar_t* __last, uninitialized_copy(const wchar_t* __first, const wchar_t* __last,
wchar_t* __result) wchar_t* __result)
{ {
...@@ -132,14 +132,14 @@ namespace std ...@@ -132,14 +132,14 @@ namespace std
// destructor is trivial. // destructor is trivial.
template<typename _ForwardIterator, typename _Tp> template<typename _ForwardIterator, typename _Tp>
inline void inline void
__uninitialized_fill_aux(_ForwardIterator __first, __uninitialized_fill_aux(_ForwardIterator __first,
_ForwardIterator __last, _ForwardIterator __last,
const _Tp& __x, __true_type) const _Tp& __x, __true_type)
{ std::fill(__first, __last, __x); } { std::fill(__first, __last, __x); }
template<typename _ForwardIterator, typename _Tp> template<typename _ForwardIterator, typename _Tp>
void void
__uninitialized_fill_aux(_ForwardIterator __first, _ForwardIterator __last, __uninitialized_fill_aux(_ForwardIterator __first, _ForwardIterator __last,
const _Tp& __x, __false_type) const _Tp& __x, __false_type)
{ {
_ForwardIterator __cur = __first; _ForwardIterator __cur = __first;
...@@ -151,7 +151,7 @@ namespace std ...@@ -151,7 +151,7 @@ namespace std
catch(...) catch(...)
{ {
std::_Destroy(__first, __cur); std::_Destroy(__first, __cur);
__throw_exception_again; __throw_exception_again;
} }
} }
...@@ -166,7 +166,7 @@ namespace std ...@@ -166,7 +166,7 @@ namespace std
*/ */
template<typename _ForwardIterator, typename _Tp> template<typename _ForwardIterator, typename _Tp>
inline void inline void
uninitialized_fill(_ForwardIterator __first, _ForwardIterator __last, uninitialized_fill(_ForwardIterator __first, _ForwardIterator __last,
const _Tp& __x) const _Tp& __x)
{ {
typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
...@@ -188,16 +188,16 @@ namespace std ...@@ -188,16 +188,16 @@ namespace std
const _Tp& __x, __false_type) const _Tp& __x, __false_type)
{ {
_ForwardIterator __cur = __first; _ForwardIterator __cur = __first;
try try
{ {
for ( ; __n > 0; --__n, ++__cur) for ( ; __n > 0; --__n, ++__cur)
std::_Construct(&*__cur, __x); std::_Construct(&*__cur, __x);
return __cur; return __cur;
} }
catch(...) catch(...)
{ {
std::_Destroy(__first, __cur); std::_Destroy(__first, __cur);
__throw_exception_again; __throw_exception_again;
} }
} }
...@@ -211,7 +211,7 @@ namespace std ...@@ -211,7 +211,7 @@ namespace std
* Like fill_n(), but does not require an initialized output range. * Like fill_n(), but does not require an initialized output range.
*/ */
template<typename _ForwardIterator, typename _Size, typename _Tp> template<typename _ForwardIterator, typename _Size, typename _Tp>
inline _ForwardIterator inline _ForwardIterator
uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x) uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x)
{ {
typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
...@@ -219,7 +219,7 @@ namespace std ...@@ -219,7 +219,7 @@ namespace std
return std::__uninitialized_fill_n_aux(__first, __n, __x, _Is_POD()); 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_fill_copy.
// __uninitialized_copy_copy // __uninitialized_copy_copy
...@@ -227,12 +227,12 @@ namespace std ...@@ -227,12 +227,12 @@ namespace std
// copies [first2, last2) into // copies [first2, last2) into
// [result, result + (last1 - first1) + (last2 - first2)). // [result, result + (last1 - first1) + (last2 - first2)).
template<typename _InputIterator1, typename _InputIterator2, template<typename _InputIterator1, typename _InputIterator2,
typename _ForwardIterator> typename _ForwardIterator>
inline _ForwardIterator inline _ForwardIterator
__uninitialized_copy_copy(_InputIterator1 __first1, __uninitialized_copy_copy(_InputIterator1 __first1,
_InputIterator1 __last1, _InputIterator1 __last1,
_InputIterator2 __first2, _InputIterator2 __first2,
_InputIterator2 __last2, _InputIterator2 __last2,
_ForwardIterator __result) _ForwardIterator __result)
{ {
...@@ -243,9 +243,9 @@ namespace std ...@@ -243,9 +243,9 @@ namespace std
return std::uninitialized_copy(__first2, __last2, __mid); return std::uninitialized_copy(__first2, __last2, __mid);
} }
catch(...) catch(...)
{ {
std::_Destroy(__result, __mid); std::_Destroy(__result, __mid);
__throw_exception_again; __throw_exception_again;
} }
} }
...@@ -253,7 +253,7 @@ namespace std ...@@ -253,7 +253,7 @@ namespace std
// Fills [result, mid) with x, and copies [first, last) into // Fills [result, mid) with x, and copies [first, last) into
// [mid, mid + (last - first)). // [mid, mid + (last - first)).
template<typename _ForwardIterator, typename _Tp, typename _InputIterator> template<typename _ForwardIterator, typename _Tp, typename _InputIterator>
inline _ForwardIterator inline _ForwardIterator
__uninitialized_fill_copy(_ForwardIterator __result, _ForwardIterator __mid, __uninitialized_fill_copy(_ForwardIterator __result, _ForwardIterator __mid,
const _Tp& __x, _InputIterator __first, const _Tp& __x, _InputIterator __first,
_InputIterator __last) _InputIterator __last)
...@@ -266,7 +266,7 @@ namespace std ...@@ -266,7 +266,7 @@ namespace std
catch(...) catch(...)
{ {
std::_Destroy(__result, __mid); std::_Destroy(__result, __mid);
__throw_exception_again; __throw_exception_again;
} }
} }
...@@ -279,16 +279,16 @@ namespace std ...@@ -279,16 +279,16 @@ namespace std
_ForwardIterator __first2, _ForwardIterator __first2,
_ForwardIterator __last2, const _Tp& __x) _ForwardIterator __last2, const _Tp& __x)
{ {
_ForwardIterator __mid2 = std::uninitialized_copy(__first1, __last1, _ForwardIterator __mid2 = std::uninitialized_copy(__first1, __last1,
__first2); __first2);
try try
{ {
std::uninitialized_fill(__mid2, __last2, __x); std::uninitialized_fill(__mid2, __last2, __x);
} }
catch(...) catch(...)
{ {
std::_Destroy(__first2, __mid2); std::_Destroy(__first2, __mid2);
__throw_exception_again; __throw_exception_again;
} }
} }
......
...@@ -42,9 +42,9 @@ ...@@ -42,9 +42,9 @@
namespace std namespace std
{ {
/// Provides input iterator semantics for streams. /// Provides input iterator semantics for streams.
template<typename _Tp, typename _CharT = char, template<typename _Tp, typename _CharT = char,
typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t> typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>
class istream_iterator class istream_iterator
: public iterator<input_iterator_tag, _Tp, _Dist, const _Tp*, const _Tp&> : public iterator<input_iterator_tag, _Tp, _Dist, const _Tp*, const _Tp&>
{ {
public: public:
...@@ -53,9 +53,9 @@ namespace std ...@@ -53,9 +53,9 @@ namespace std
typedef basic_istream<_CharT, _Traits> istream_type; typedef basic_istream<_CharT, _Traits> istream_type;
private: private:
istream_type* _M_stream; istream_type* _M_stream;
_Tp _M_value; _Tp _M_value;
bool _M_ok; bool _M_ok;
public: public:
/// Construct end of input stream iterator. /// Construct end of input stream iterator.
...@@ -67,14 +67,14 @@ namespace std ...@@ -67,14 +67,14 @@ namespace std
: _M_stream(&__s) : _M_stream(&__s)
{ _M_read(); } { _M_read(); }
istream_iterator(const istream_iterator& __obj) istream_iterator(const istream_iterator& __obj)
: _M_stream(__obj._M_stream), _M_value(__obj._M_value), : _M_stream(__obj._M_stream), _M_value(__obj._M_value),
_M_ok(__obj._M_ok) _M_ok(__obj._M_ok)
{ } { }
const _Tp& const _Tp&
operator*() const operator*() const
{ {
__glibcxx_requires_cond(_M_ok, __glibcxx_requires_cond(_M_ok,
_M_message(__gnu_debug::__msg_deref_istream) _M_message(__gnu_debug::__msg_deref_istream)
._M_iterator(*this)); ._M_iterator(*this));
...@@ -84,34 +84,34 @@ namespace std ...@@ -84,34 +84,34 @@ namespace std
const _Tp* const _Tp*
operator->() const { return &(operator*()); } operator->() const { return &(operator*()); }
istream_iterator& istream_iterator&
operator++() operator++()
{ {
__glibcxx_requires_cond(_M_ok, __glibcxx_requires_cond(_M_ok,
_M_message(__gnu_debug::__msg_inc_istream) _M_message(__gnu_debug::__msg_inc_istream)
._M_iterator(*this)); ._M_iterator(*this));
_M_read(); _M_read();
return *this; return *this;
} }
istream_iterator istream_iterator
operator++(int) operator++(int)
{ {
__glibcxx_requires_cond(_M_ok, __glibcxx_requires_cond(_M_ok,
_M_message(__gnu_debug::__msg_inc_istream) _M_message(__gnu_debug::__msg_inc_istream)
._M_iterator(*this)); ._M_iterator(*this));
istream_iterator __tmp = *this; istream_iterator __tmp = *this;
_M_read(); _M_read();
return __tmp; return __tmp;
} }
bool bool
_M_equal(const istream_iterator& __x) const _M_equal(const istream_iterator& __x) const
{ return (_M_ok == __x._M_ok) && (!_M_ok || _M_stream == __x._M_stream); } { return (_M_ok == __x._M_ok) && (!_M_ok || _M_stream == __x._M_stream); }
private: private:
void void
_M_read() _M_read()
{ {
_M_ok = (_M_stream && *_M_stream) ? true : false; _M_ok = (_M_stream && *_M_stream) ? true : false;
if (_M_ok) if (_M_ok)
...@@ -121,19 +121,19 @@ namespace std ...@@ -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. /// 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> template<typename _Tp, typename _CharT, typename _Traits, typename _Dist>
inline bool inline bool
operator==(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x, 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 __x._M_equal(__y); }
/// Return false if x and y are both end or not end, or x and y are the same. /// 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> template <class _Tp, class _CharT, class _Traits, class _Dist>
inline bool inline bool
operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x, 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 !__x._M_equal(__y); }
/** /**
...@@ -147,9 +147,9 @@ namespace std ...@@ -147,9 +147,9 @@ namespace std
* @param CharT The ostream char_type. * @param CharT The ostream char_type.
* @param Traits The ostream char_traits. * @param Traits The ostream char_traits.
*/ */
template<typename _Tp, typename _CharT = char, template<typename _Tp, typename _CharT = char,
typename _Traits = char_traits<_CharT> > typename _Traits = char_traits<_CharT> >
class ostream_iterator class ostream_iterator
: public iterator<output_iterator_tag, void, void, void, void> : public iterator<output_iterator_tag, void, void, void, void>
{ {
public: public:
...@@ -161,8 +161,8 @@ namespace std ...@@ -161,8 +161,8 @@ namespace std
//@} //@}
private: private:
ostream_type* _M_stream; ostream_type* _M_stream;
const _CharT* _M_string; const _CharT* _M_string;
public: public:
/// Construct from an ostream. /// Construct from an ostream.
...@@ -178,7 +178,7 @@ namespace std ...@@ -178,7 +178,7 @@ namespace std
* @param s Underlying ostream to write to. * @param s Underlying ostream to write to.
* @param c CharT delimiter string to insert. * @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) { } : _M_stream(&__s), _M_string(__c) { }
/// Copy constructor. /// Copy constructor.
...@@ -187,9 +187,9 @@ namespace std ...@@ -187,9 +187,9 @@ namespace std
/// Writes @a value to underlying ostream using operator<<. If /// Writes @a value to underlying ostream using operator<<. If
/// constructed with delimiter string, writes delimiter to ostream. /// constructed with delimiter string, writes delimiter to ostream.
ostream_iterator& ostream_iterator&
operator=(const _Tp& __value) operator=(const _Tp& __value)
{ {
__glibcxx_requires_cond(_M_stream != 0, __glibcxx_requires_cond(_M_stream != 0,
_M_message(__gnu_debug::__msg_output_ostream) _M_message(__gnu_debug::__msg_output_ostream)
._M_iterator(*this)); ._M_iterator(*this));
...@@ -197,18 +197,18 @@ namespace std ...@@ -197,18 +197,18 @@ namespace std
if (_M_string) *_M_stream << _M_string; if (_M_string) *_M_stream << _M_string;
return *this; return *this;
} }
ostream_iterator& ostream_iterator&
operator*() operator*()
{ return *this; } { return *this; }
ostream_iterator& ostream_iterator&
operator++() operator++()
{ return *this; } { return *this; }
ostream_iterator& ostream_iterator&
operator++(int) operator++(int)
{ return *this; } { return *this; }
}; };
} // namespace std } // namespace std
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment