diff options
Diffstat (limited to 'libstdc++-v3')
65 files changed, 3470 insertions, 3434 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 7818cf292cd..97126b3bae5 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,39 @@ +2004-02-08 Bernardo Innocenti <bernie@develer.com> + + * include/bits/allocator.h, include/bits/basic_ios.h, + include/bits/basic_ios.tcc, include/bits/basic_string.h, + include/bits/basic_string.tcc, include/bits/boost_concept_check.h, + include/bits/char_traits.h, include/bits/codecvt.h, + include/bits/concurrence.h, include/bits/cpp_type_traits.h, + include/bits/demangle.h, include/bits/deque.tcc, + include/bits/fstream.tcc, include/bits/functexcept.h, + include/bits/gslice.h, include/bits/gslice_array.h, + include/bits/indirect_array.h, include/bits/ios_base.h, + include/bits/istream.tcc, include/bits/list.tcc, + include/bits/locale_classes.h, include/bits/locale_facets.h, + include/bits/locale_facets.tcc, include/bits/localefwd.h, + include/bits/mask_array.h, include/bits/ostream.tcc, + include/bits/postypes.h, include/bits/slice_array.h, + include/bits/sstream.tcc, include/bits/stl_algo.h, + include/bits/stl_algobase.h, include/bits/stl_bvector.h, + include/bits/stl_construct.h, include/bits/stl_deque.h, + include/bits/stl_function.h, include/bits/stl_heap.h, + include/bits/stl_iterator.h, include/bits/stl_iterator_base_funcs.h, + include/bits/stl_list.h, include/bits/stl_map.h, + include/bits/stl_multimap.h, include/bits/stl_multiset.h, + include/bits/stl_numeric.h, include/bits/stl_pair.h, + include/bits/stl_queue.h, include/bits/stl_raw_storage_iter.h, + include/bits/stl_relops.h, include/bits/stl_set.h, + include/bits/stl_stack.h, include/bits/stl_tempbuf.h, + include/bits/stl_threads.h, include/bits/stl_tree.h, + include/bits/stl_uninitialized.h, include/bits/stl_vector.h, + include/bits/stream_iterator.h, include/bits/streambuf.tcc, + include/bits/streambuf_iterator.h,include/bits/stringfwd.h, + include/bits/type_traits.h, include/bits/valarray_after.h, + include/bits/valarray_array.h, include/bits/valarray_array.tcc, + include/bits/valarray_before.h, include/bits/vector.tcc: Remove + trailing whitespace. + 2004-02-06 Paolo Carlini <pcarlini@suse.de> * include/bits/basic_string.h: Fix comment. diff --git a/libstdc++-v3/include/bits/allocator.h b/libstdc++-v3/include/bits/allocator.h index 9c7b3eedefd..a1b04b4338d 100644 --- a/libstdc++-v3/include/bits/allocator.h +++ b/libstdc++-v3/include/bits/allocator.h @@ -84,7 +84,7 @@ namespace std * (See @link Allocators allocators info @endlink for more.) */ template<typename _Tp> - class allocator: public __glibcxx_default_allocator<_Tp> + class allocator: public __glibcxx_default_allocator<_Tp> { public: typedef size_t size_type; @@ -101,7 +101,7 @@ namespace std allocator() throw() { } - allocator(const allocator& a) throw() + allocator(const allocator& a) throw() : __glibcxx_default_allocator<_Tp>(a) { } template<typename _Tp1> diff --git a/libstdc++-v3/include/bits/basic_ios.h b/libstdc++-v3/include/bits/basic_ios.h index a9cb8d25dd9..8e0b31e37de 100644 --- a/libstdc++-v3/include/bits/basic_ios.h +++ b/libstdc++-v3/include/bits/basic_ios.h @@ -1,6 +1,6 @@ // Iostreams base classes -*- C++ -*- -// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003 +// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -43,7 +43,7 @@ #include <bits/locale_classes.h> #include <bits/locale_facets.h> -namespace std +namespace std { // 27.4.5 Template class basic_ios /** @@ -76,12 +76,12 @@ namespace std * @endif */ typedef ctype<_CharT> __ctype_type; - typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> > + typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> > __num_put_type; - typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> > - __num_get_type; + typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> > + __num_get_type; //@} - + // Data members: protected: basic_ostream<_CharT, _Traits>* _M_tie; @@ -90,7 +90,7 @@ namespace std basic_streambuf<_CharT, _Traits>* _M_streambuf; // Cached use_facet<ctype>, which is based on the current locale info. - const __ctype_type* _M_ctype; + const __ctype_type* _M_ctype; // For ostream. const __num_put_type* _M_num_put; // For istream. @@ -104,11 +104,11 @@ namespace std * This allows you to write constructs such as * "if (!a_stream) ..." and "while (a_stream) ..." */ - operator void*() const + operator void*() const { return this->fail() ? 0 : const_cast<basic_ios*>(this); } - bool - operator!() const + bool + operator!() const { return this->fail(); } //@} @@ -119,8 +119,8 @@ namespace std * See std::ios_base::iostate for the possible bit values. Most * users will call one of the interpreting wrappers, e.g., good(). */ - iostate - rdstate() const + iostate + rdstate() const { return _M_streambuf_state; } /** @@ -130,7 +130,7 @@ namespace std * See std::ios_base::iostate for the possible bit values. Most * users will not need to pass an argument. */ - void + void clear(iostate __state = goodbit); /** @@ -139,19 +139,19 @@ namespace std * * See std::ios_base::iostate for the possible bit values. */ - void - setstate(iostate __state) + void + setstate(iostate __state) { this->clear(this->rdstate() | __state); } // Flip the internal state on for the proper state bits, then re // throws the propagated exception if bit also set in // exceptions(). void - _M_setstate(iostate __state) - { + _M_setstate(iostate __state) + { // 27.6.1.2.1 Common requirements. // Turn this on without causing an ios::failure to be thrown. - _M_streambuf_state |= __state; + _M_streambuf_state |= __state; if (this->exceptions() & __state) __throw_exception_again; } @@ -162,8 +162,8 @@ namespace std * * A wrapper around rdstate. */ - bool - good() const + bool + good() const { return this->rdstate() == 0; } /** @@ -172,8 +172,8 @@ namespace std * * Note that other iostate flags may also be set. */ - bool - eof() const + bool + eof() const { return (this->rdstate() & eofbit) != 0; } /** @@ -183,8 +183,8 @@ namespace std * Checking the badbit in fail() is historical practice. * Note that other iostate flags may also be set. */ - bool - fail() const + bool + fail() const { return (this->rdstate() & (badbit | failbit)) != 0; } /** @@ -193,8 +193,8 @@ namespace std * * Note that other iostate flags may also be set. */ - bool - bad() const + bool + bad() const { return (this->rdstate() & badbit) != 0; } /** @@ -204,8 +204,8 @@ namespace std * This changes nothing in the stream. See the one-argument version * of exceptions(iostate) for the meaning of the return value. */ - iostate - exceptions() const + iostate + exceptions() const { return _M_exception; } /** @@ -224,26 +224,26 @@ namespace std * #include <iostream> * #include <fstream> * #include <exception> - * + * * int main() * { * std::set_terminate (__gnu_cxx::__verbose_terminate_handler); - * + * * std::ifstream f ("/etc/motd"); - * + * * std::cerr << "Setting badbit\n"; * f.setstate (std::ios_base::badbit); - * + * * std::cerr << "Setting exception mask\n"; * f.exceptions (std::ios_base::badbit); * } * @endcode */ - void - exceptions(iostate __except) - { - _M_exception = __except; - this->clear(_M_streambuf_state); + void + exceptions(iostate __except) + { + _M_exception = __except; + this->clear(_M_streambuf_state); } // Constructor/destructor: @@ -252,8 +252,8 @@ namespace std * * The parameter is passed by derived streams. */ - explicit - basic_ios(basic_streambuf<_CharT, _Traits>* __sb) + explicit + basic_ios(basic_streambuf<_CharT, _Traits>* __sb) : ios_base(), _M_ctype(0), _M_num_put(0), _M_num_get(0) { this->init(__sb); } @@ -263,9 +263,9 @@ namespace std * The destructor does nothing. More specifically, it does not * destroy the streambuf held by rdbuf(). */ - virtual + virtual ~basic_ios() { } - + // Members: /** * @brief Fetches the current @e tied stream. @@ -277,7 +277,7 @@ namespace std * first flushed. For example, @c std::cin is tied to @c std::cout. */ basic_ostream<_CharT, _Traits>* - tie() const + tie() const { return _M_tie; } /** @@ -303,7 +303,7 @@ namespace std * This does not change the state of the stream. */ basic_streambuf<_CharT, _Traits>* - rdbuf() const + rdbuf() const { return _M_streambuf; } /** @@ -328,7 +328,7 @@ namespace std * foo.ios::rdbuf(p); // ios == basic_ios<char> * @endcode */ - basic_streambuf<_CharT, _Traits>* + basic_streambuf<_CharT, _Traits>* rdbuf(basic_streambuf<_CharT, _Traits>* __sb); /** @@ -351,15 +351,15 @@ namespace std * * It defaults to a space (' ') in the current locale. */ - char_type - fill() const + char_type + fill() const { if (!_M_fill_init) { _M_fill = this->widen(' '); _M_fill_init = true; } - return _M_fill; + return _M_fill; } /** @@ -371,7 +371,7 @@ namespace std * have been requested (e.g., via setw), Q characters are actually * used, and Q<P. It defaults to a space (' ') in the current locale. */ - char_type + char_type fill(char_type __ch) { char_type __old = this->fill(); @@ -391,7 +391,7 @@ namespace std * Additional l10n notes are at * http://gcc.gnu.org/onlinedocs/libstdc++/22_locale/howto.html */ - locale + locale imbue(const locale& __loc); /** @@ -411,7 +411,7 @@ namespace std * Additional l10n notes are at * http://gcc.gnu.org/onlinedocs/libstdc++/22_locale/howto.html */ - char + char narrow(char_type __c, char __dfault) const; /** @@ -429,9 +429,9 @@ namespace std * Additional l10n notes are at * http://gcc.gnu.org/onlinedocs/libstdc++/22_locale/howto.html */ - char_type + char_type widen(char __c) const; - + protected: // 27.4.5.1 basic_ios constructors /** @@ -449,7 +449,7 @@ namespace std * This is called from the public constructor. It is not virtual and * cannot be redefined. */ - void + void init(basic_streambuf<_CharT, _Traits>* __sb); void diff --git a/libstdc++-v3/include/bits/basic_ios.tcc b/libstdc++-v3/include/bits/basic_ios.tcc index ce7af0d27f6..cc730672af9 100644 --- a/libstdc++-v3/include/bits/basic_ios.tcc +++ b/libstdc++-v3/include/bits/basic_ios.tcc @@ -37,7 +37,7 @@ namespace std template<typename _CharT, typename _Traits> void basic_ios<_CharT, _Traits>::clear(iostate __state) - { + { if (this->rdbuf()) _M_streambuf_state = __state; else @@ -45,9 +45,9 @@ namespace std if (this->exceptions() & this->rdstate()) __throw_ios_failure(__N("basic_ios::clear")); } - + template<typename _CharT, typename _Traits> - basic_streambuf<_CharT, _Traits>* + basic_streambuf<_CharT, _Traits>* basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<_CharT, _Traits>* __sb) { basic_streambuf<_CharT, _Traits>* __old = _M_streambuf; @@ -66,17 +66,17 @@ namespace std { // Per 27.1.1, do not call imbue, yet must trash all caches // associated with imbue() - + // Alloc any new word array first, so if it fails we have "rollback". _Words* __words = (__rhs._M_word_size <= _S_local_word_size) ? _M_local_word : new _Words[__rhs._M_word_size]; // Bump refs before doing callbacks, for safety. _Callback_list* __cb = __rhs._M_callbacks; - if (__cb) + if (__cb) __cb->_M_add_reference(); _M_call_callbacks(erase_event); - if (_M_word != _M_local_word) + if (_M_word != _M_local_word) { delete [] _M_word; _M_word = 0; @@ -84,17 +84,17 @@ namespace std _M_dispose_callbacks(); // NB: Don't want any added during above. - _M_callbacks = __cb; + _M_callbacks = __cb; for (int __i = 0; __i < __rhs._M_word_size; ++__i) __words[__i] = __rhs._M_word[__i]; - if (_M_word != _M_local_word) + if (_M_word != _M_local_word) { delete [] _M_word; _M_word = 0; } _M_word = __words; _M_word_size = __rhs._M_word_size; - + this->flags(__rhs.flags()); this->width(__rhs.width()); this->precision(__rhs.precision()); @@ -102,9 +102,9 @@ namespace std this->fill(__rhs.fill()); _M_ios_locale = __rhs.getloc(); _M_cache_locale(_M_ios_locale); - + _M_call_callbacks(copyfmt_event); - + // The next is required to be the last assignment. this->exceptions(__rhs.exceptions()); } @@ -172,13 +172,13 @@ namespace std if (__builtin_expect(has_facet<__ctype_type>(__loc), true)) _M_ctype = &use_facet<__ctype_type>(__loc); if (__builtin_expect(has_facet<__num_put_type>(__loc), true)) - _M_num_put = &use_facet<__num_put_type>(__loc); + _M_num_put = &use_facet<__num_put_type>(__loc); if (__builtin_expect(has_facet<__num_get_type>(__loc), true)) - _M_num_get = &use_facet<__num_get_type>(__loc); + _M_num_get = &use_facet<__num_get_type>(__loc); } // Inhibit implicit instantiations for required instantiations, - // which are defined via explicit instantiations elsewhere. + // which are defined via explicit instantiations elsewhere. // NB: This syntax is a GNU extension. #if _GLIBCXX_EXTERN_TEMPLATE extern template class basic_ios<char>; @@ -189,4 +189,4 @@ namespace std #endif } // namespace std -#endif +#endif diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h index 2103f63d3ef..26c33429ee4 100644 --- a/libstdc++-v3/include/bits/basic_string.h +++ b/libstdc++-v3/include/bits/basic_string.h @@ -111,20 +111,20 @@ namespace std { // Types: public: - typedef _Traits traits_type; - typedef typename _Traits::char_type value_type; - typedef _Alloc allocator_type; - typedef typename _Alloc::size_type size_type; - typedef typename _Alloc::difference_type difference_type; - typedef typename _Alloc::reference reference; - typedef typename _Alloc::const_reference const_reference; - typedef typename _Alloc::pointer pointer; - typedef typename _Alloc::const_pointer const_pointer; + typedef _Traits traits_type; + typedef typename _Traits::char_type value_type; + typedef _Alloc allocator_type; + typedef typename _Alloc::size_type size_type; + typedef typename _Alloc::difference_type difference_type; + typedef typename _Alloc::reference reference; + typedef typename _Alloc::const_reference const_reference; + typedef typename _Alloc::pointer pointer; + typedef typename _Alloc::const_pointer const_pointer; typedef __gnu_cxx::__normal_iterator<pointer, basic_string> iterator; typedef __gnu_cxx::__normal_iterator<const_pointer, basic_string> const_iterator; - typedef std::reverse_iterator<const_iterator> const_reverse_iterator; - typedef std::reverse_iterator<iterator> reverse_iterator; + typedef std::reverse_iterator<const_iterator> const_reverse_iterator; + typedef std::reverse_iterator<iterator> reverse_iterator; private: // _Rep: string representation @@ -143,8 +143,8 @@ namespace std struct _Rep_base { - size_type _M_length; - size_type _M_capacity; + size_type _M_length; + size_type _M_capacity; _Atomic_word _M_refcount; }; @@ -166,17 +166,17 @@ namespace std // Solving for m: // m = ((npos - sizeof(_Rep))/sizeof(CharT)) - 1 // In addition, this implementation quarters this amount. - static const size_type _S_max_size; - static const _CharT _S_terminal; + static const size_type _S_max_size; + static const _CharT _S_terminal; // The following storage is init'd to 0 by the linker, resulting // (carefully) in an empty string with one reference. static size_type _S_empty_rep_storage[]; - static _Rep& + static _Rep& _S_empty_rep() { return *reinterpret_cast<_Rep*>(&_S_empty_rep_storage); } - + bool _M_is_leaked() const { return this->_M_refcount < 0; } @@ -246,11 +246,11 @@ namespace std // size that the allocator can hold. /// @var /// Value returned by various member functions when they fail. - static const size_type npos = static_cast<size_type>(-1); + static const size_type npos = static_cast<size_type>(-1); private: // Data Members (private): - mutable _Alloc_hider _M_dataplus; + mutable _Alloc_hider _M_dataplus; _CharT* _M_data() const @@ -377,7 +377,7 @@ namespace std * @param s Source character array. * @param n Number of characters to copy. * @param a Allocator to use (default is default allocator). - * + * * NB: s must have at least n characters, '\0' has no special * meaning. */ @@ -606,9 +606,9 @@ namespace std */ const_reference operator[] (size_type __pos) const - { + { _GLIBCXX_DEBUG_ASSERT(__pos <= size()); - return _M_data()[__pos]; + return _M_data()[__pos]; } /** @@ -731,9 +731,9 @@ namespace std */ basic_string& append(const _CharT* __s) - { + { __glibcxx_requires_string(__s); - return this->append(__s, traits_type::length(__s)); + return this->append(__s, traits_type::length(__s)); } /** @@ -819,9 +819,9 @@ namespace std */ basic_string& assign(const _CharT* __s) - { + { __glibcxx_requires_string(__s); - return this->assign(__s, traits_type::length(__s)); + return this->assign(__s, traits_type::length(__s)); } /** @@ -870,7 +870,7 @@ namespace std * @brief Insert a range of characters. * @param p Iterator referencing location in string to insert at. * @param beg Start of range. - * @param end End of range. + * @param end End of range. * @throw std::length_error If new length exceeds @c max_size(). * * Inserts characters in range [beg,end). If adding characters causes @@ -929,7 +929,7 @@ namespace std * @return Reference to this string. * @throw std::length_error If new length exceeds @c max_size(). * @throw std::out_of_range If @a pos is beyond the end of this - * string. + * string. * * Inserts the first @a n characters of @a s starting at @a pos. If * adding characters causes the length to exceed max_size(), @@ -957,9 +957,9 @@ namespace std */ basic_string& insert(size_type __pos, const _CharT* __s) - { + { __glibcxx_requires_string(__s); - return this->insert(__pos, __s, traits_type::length(__s)); + return this->insert(__pos, __s, traits_type::length(__s)); } /** @@ -1002,7 +1002,7 @@ namespace std const size_type __pos = __p - _M_ibegin(); _M_replace_aux(__pos, size_type(0), size_type(1), __c); _M_rep()->_M_set_leaked(); - return this->_M_ibegin() + __pos; + return this->_M_ibegin() + __pos; } /** @@ -1035,7 +1035,7 @@ namespace std iterator erase(iterator __position) { - _GLIBCXX_DEBUG_PEDASSERT(__position >= _M_ibegin() + _GLIBCXX_DEBUG_PEDASSERT(__position >= _M_ibegin() && __position < _M_iend()); const size_type __pos = __position - _M_ibegin(); _M_replace_safe(__pos, size_type(1), NULL, size_type(0)); @@ -1070,7 +1070,7 @@ namespace std * @param str String to insert. * @return Reference to this string. * @throw std::out_of_range If @a pos is beyond the end of this - * string. + * string. * @throw std::length_error If new length exceeds @c max_size(). * * Removes the characters in the range [pos,pos+n) from this string. @@ -1092,7 +1092,7 @@ namespace std * @param n2 Number of characters from str to use. * @return Reference to this string. * @throw std::out_of_range If @a pos1 > size() or @a pos2 > - * str.size(). + * str.size(). * @throw std::length_error If new length exceeds @c max_size(). * * Removes the characters in the range [pos1,pos1 + n) from this @@ -1146,9 +1146,9 @@ namespace std */ basic_string& replace(size_type __pos, size_type __n1, const _CharT* __s) - { + { __glibcxx_requires_string(__s); - return this->replace(__pos, __n1, __s, traits_type::length(__s)); + return this->replace(__pos, __n1, __s, traits_type::length(__s)); } /** @@ -1207,7 +1207,7 @@ namespace std replace(iterator __i1, iterator __i2, const _CharT* __s, size_type __n) { _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2 - && __i2 <= _M_iend()); + && __i2 <= _M_iend()); return this->replace(__i1 - _M_ibegin(), __i2 - __i1, __s, __n); } @@ -1226,9 +1226,9 @@ namespace std */ basic_string& replace(iterator __i1, iterator __i2, const _CharT* __s) - { + { __glibcxx_requires_string(__s); - return this->replace(__i1, __i2, __s, traits_type::length(__s)); + return this->replace(__i1, __i2, __s, traits_type::length(__s)); } /** @@ -1247,10 +1247,10 @@ namespace std */ basic_string& replace(iterator __i1, iterator __i2, size_type __n, _CharT __c) - { + { _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2 && __i2 <= _M_iend()); - return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __c); + return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __c); } /** @@ -1271,40 +1271,40 @@ namespace std basic_string& replace(iterator __i1, iterator __i2, _InputIterator __k1, _InputIterator __k2) - { + { _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2 && __i2 <= _M_iend()); __glibcxx_requires_valid_range(__k1, __k2); typedef typename _Is_integer<_InputIterator>::_Integral _Integral; - return _M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral()); + return _M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral()); } // Specializations for the common case of pointer and iterator: // useful to avoid the overhead of temporary buffering in _M_replace. basic_string& replace(iterator __i1, iterator __i2, _CharT* __k1, _CharT* __k2) - { + { _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2 && __i2 <= _M_iend()); __glibcxx_requires_valid_range(__k1, __k2); return this->replace(__i1 - _M_ibegin(), __i2 - __i1, - __k1, __k2 - __k1); + __k1, __k2 - __k1); } basic_string& - replace(iterator __i1, iterator __i2, + replace(iterator __i1, iterator __i2, const _CharT* __k1, const _CharT* __k2) - { + { _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2 && __i2 <= _M_iend()); __glibcxx_requires_valid_range(__k1, __k2); return this->replace(__i1 - _M_ibegin(), __i2 - __i1, - __k1, __k2 - __k1); + __k1, __k2 - __k1); } basic_string& replace(iterator __i1, iterator __i2, iterator __k1, iterator __k2) - { + { _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2 && __i2 <= _M_iend()); __glibcxx_requires_valid_range(__k1, __k2); @@ -1313,9 +1313,9 @@ namespace std } basic_string& - replace(iterator __i1, iterator __i2, + replace(iterator __i1, iterator __i2, const_iterator __k1, const_iterator __k2) - { + { _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2 && __i2 <= _M_iend()); __glibcxx_requires_valid_range(__k1, __k2); @@ -1326,7 +1326,7 @@ namespace std private: template<class _Integer> basic_string& - _M_replace_dispatch(iterator __i1, iterator __i2, _Integer __n, + _M_replace_dispatch(iterator __i1, iterator __i2, _Integer __n, _Integer __val, __true_type) { return _M_replace_aux(__i1 - _M_ibegin(), __i2 - __i1, __n, __val); } @@ -1344,7 +1344,7 @@ namespace std _M_mutate(__pos1, __n1, __n2); if (__n2) traits_type::assign(_M_data() + __pos1, __n2, __c); - return *this; + return *this; } basic_string& @@ -1354,7 +1354,7 @@ namespace std _M_mutate(__pos1, __n1, __n2); if (__n2) traits_type::copy(_M_data() + __pos1, __s, __n2); - return *this; + return *this; } // _S_construct_aux is used to implement the 21.3.1 para 15 which @@ -1490,9 +1490,9 @@ namespace std */ size_type find(const _CharT* __s, size_type __pos = 0) const - { + { __glibcxx_requires_string(__s); - return this->find(__s, __pos, traits_type::length(__s)); + return this->find(__s, __pos, traits_type::length(__s)); } /** @@ -1548,9 +1548,9 @@ namespace std */ size_type rfind(const _CharT* __s, size_type __pos = npos) const - { + { __glibcxx_requires_string(__s); - return this->rfind(__s, __pos, traits_type::length(__s)); + return this->rfind(__s, __pos, traits_type::length(__s)); } /** @@ -1606,9 +1606,9 @@ namespace std */ size_type find_first_of(const _CharT* __s, size_type __pos = 0) const - { + { __glibcxx_requires_string(__s); - return this->find_first_of(__s, __pos, traits_type::length(__s)); + return this->find_first_of(__s, __pos, traits_type::length(__s)); } /** @@ -1667,9 +1667,9 @@ namespace std */ size_type find_last_of(const _CharT* __s, size_type __pos = npos) const - { + { __glibcxx_requires_string(__s); - return this->find_last_of(__s, __pos, traits_type::length(__s)); + return this->find_last_of(__s, __pos, traits_type::length(__s)); } /** @@ -1729,9 +1729,9 @@ namespace std */ size_type find_first_not_of(const _CharT* __s, size_type __pos = 0) const - { + { __glibcxx_requires_string(__s); - return this->find_first_not_of(__s, __pos, traits_type::length(__s)); + return this->find_first_not_of(__s, __pos, traits_type::length(__s)); } /** @@ -1788,9 +1788,9 @@ namespace std */ size_type find_last_not_of(const _CharT* __s, size_type __pos = npos) const - { + { __glibcxx_requires_string(__s); - return this->find_last_not_of(__s, __pos, traits_type::length(__s)); + return this->find_last_not_of(__s, __pos, traits_type::length(__s)); } /** @@ -1935,7 +1935,7 @@ namespace std * Returns an integer < 0 if this substring is ordered before the string * from @a s, 0 if their values are equivalent, or > 0 if this substring * is ordered after the string from @a s. If the lengths of this - * substring and @a n2 are different, the shorter one is ordered first. + * substring and @a n2 are different, the shorter one is ordered first. * If they are the same, returns the result of * traits::compare(substring.data(),s,size()); * @@ -1959,7 +1959,7 @@ namespace std * @param lhs First string. * @param rhs Last string. * @return New string with value of @a lhs followed by @a rhs. - */ + */ template<typename _CharT, typename _Traits, typename _Alloc> basic_string<_CharT, _Traits, _Alloc> operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, @@ -1975,7 +1975,7 @@ namespace std * @param lhs First string. * @param rhs Last string. * @return New string with value of @a lhs followed by @a rhs. - */ + */ template<typename _CharT, typename _Traits, typename _Alloc> basic_string<_CharT,_Traits,_Alloc> operator+(const _CharT* __lhs, @@ -1986,7 +1986,7 @@ namespace std * @param lhs First string. * @param rhs Last string. * @return New string with @a lhs followed by @a rhs. - */ + */ template<typename _CharT, typename _Traits, typename _Alloc> basic_string<_CharT,_Traits,_Alloc> operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs); @@ -1996,7 +1996,7 @@ namespace std * @param lhs First string. * @param rhs Last string. * @return New string with @a lhs followed by @a rhs. - */ + */ template<typename _CharT, typename _Traits, typename _Alloc> inline basic_string<_CharT, _Traits, _Alloc> operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, @@ -2012,12 +2012,12 @@ namespace std * @param lhs First string. * @param rhs Last string. * @return New string with @a lhs followed by @a rhs. - */ + */ template<typename _CharT, typename _Traits, typename _Alloc> inline basic_string<_CharT, _Traits, _Alloc> operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) { - typedef basic_string<_CharT, _Traits, _Alloc> __string_type; + typedef basic_string<_CharT, _Traits, _Alloc> __string_type; typedef typename __string_type::size_type __size_type; __string_type __str(__lhs); __str.append(__size_type(1), __rhs); @@ -2030,7 +2030,7 @@ namespace std * @param lhs First string. * @param rhs Second string. * @return True if @a lhs.compare(@a rhs) == 0. False otherwise. - */ + */ template<typename _CharT, typename _Traits, typename _Alloc> inline bool operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, @@ -2042,7 +2042,7 @@ namespace std * @param lhs C string. * @param rhs String. * @return True if @a rhs.compare(@a lhs) == 0. False otherwise. - */ + */ template<typename _CharT, typename _Traits, typename _Alloc> inline bool operator==(const _CharT* __lhs, @@ -2054,7 +2054,7 @@ namespace std * @param lhs String. * @param rhs C string. * @return True if @a lhs.compare(@a rhs) == 0. False otherwise. - */ + */ template<typename _CharT, typename _Traits, typename _Alloc> inline bool operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, @@ -2067,7 +2067,7 @@ namespace std * @param lhs First string. * @param rhs Second string. * @return True if @a lhs.compare(@a rhs) != 0. False otherwise. - */ + */ template<typename _CharT, typename _Traits, typename _Alloc> inline bool operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, @@ -2079,7 +2079,7 @@ namespace std * @param lhs C string. * @param rhs String. * @return True if @a rhs.compare(@a lhs) != 0. False otherwise. - */ + */ template<typename _CharT, typename _Traits, typename _Alloc> inline bool operator!=(const _CharT* __lhs, @@ -2091,7 +2091,7 @@ namespace std * @param lhs String. * @param rhs C string. * @return True if @a lhs.compare(@a rhs) != 0. False otherwise. - */ + */ template<typename _CharT, typename _Traits, typename _Alloc> inline bool operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, @@ -2104,7 +2104,7 @@ namespace std * @param lhs First string. * @param rhs Second string. * @return True if @a lhs precedes @a rhs. False otherwise. - */ + */ template<typename _CharT, typename _Traits, typename _Alloc> inline bool operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, @@ -2116,7 +2116,7 @@ namespace std * @param lhs String. * @param rhs C string. * @return True if @a lhs precedes @a rhs. False otherwise. - */ + */ template<typename _CharT, typename _Traits, typename _Alloc> inline bool operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, @@ -2128,7 +2128,7 @@ namespace std * @param lhs C string. * @param rhs String. * @return True if @a lhs precedes @a rhs. False otherwise. - */ + */ template<typename _CharT, typename _Traits, typename _Alloc> inline bool operator<(const _CharT* __lhs, @@ -2141,7 +2141,7 @@ namespace std * @param lhs First string. * @param rhs Second string. * @return True if @a lhs follows @a rhs. False otherwise. - */ + */ template<typename _CharT, typename _Traits, typename _Alloc> inline bool operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, @@ -2153,7 +2153,7 @@ namespace std * @param lhs String. * @param rhs C string. * @return True if @a lhs follows @a rhs. False otherwise. - */ + */ template<typename _CharT, typename _Traits, typename _Alloc> inline bool operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, @@ -2165,7 +2165,7 @@ namespace std * @param lhs C string. * @param rhs String. * @return True if @a lhs follows @a rhs. False otherwise. - */ + */ template<typename _CharT, typename _Traits, typename _Alloc> inline bool operator>(const _CharT* __lhs, @@ -2178,7 +2178,7 @@ namespace std * @param lhs First string. * @param rhs Second string. * @return True if @a lhs doesn't follow @a rhs. False otherwise. - */ + */ template<typename _CharT, typename _Traits, typename _Alloc> inline bool operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, @@ -2190,7 +2190,7 @@ namespace std * @param lhs String. * @param rhs C string. * @return True if @a lhs doesn't follow @a rhs. False otherwise. - */ + */ template<typename _CharT, typename _Traits, typename _Alloc> inline bool operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, @@ -2202,7 +2202,7 @@ namespace std * @param lhs C string. * @param rhs String. * @return True if @a lhs doesn't follow @a rhs. False otherwise. - */ + */ template<typename _CharT, typename _Traits, typename _Alloc> inline bool operator<=(const _CharT* __lhs, @@ -2215,7 +2215,7 @@ namespace std * @param lhs First string. * @param rhs Second string. * @return True if @a lhs doesn't precede @a rhs. False otherwise. - */ + */ template<typename _CharT, typename _Traits, typename _Alloc> inline bool operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, @@ -2227,7 +2227,7 @@ namespace std * @param lhs String. * @param rhs C string. * @return True if @a lhs doesn't precede @a rhs. False otherwise. - */ + */ template<typename _CharT, typename _Traits, typename _Alloc> inline bool operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, @@ -2239,7 +2239,7 @@ namespace std * @param lhs C string. * @param rhs String. * @return True if @a lhs doesn't precede @a rhs. False otherwise. - */ + */ template<typename _CharT, typename _Traits, typename _Alloc> inline bool operator>=(const _CharT* __lhs, @@ -2251,7 +2251,7 @@ namespace std * @param lhs First string. * @param rhs Second string. * - * Exchanges the contents of @a lhs and @a rhs in constant time. + * Exchanges the contents of @a lhs and @a rhs in constant time. */ template<typename _CharT, typename _Traits, typename _Alloc> inline void diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/include/bits/basic_string.tcc index 0e80f596745..729b86cca0e 100644 --- a/libstdc++-v3/include/bits/basic_string.tcc +++ b/libstdc++-v3/include/bits/basic_string.tcc @@ -56,12 +56,12 @@ namespace std { return false; } template<typename _CharT, typename _Traits, typename _Alloc> - const typename basic_string<_CharT, _Traits, _Alloc>::size_type + const typename basic_string<_CharT, _Traits, _Alloc>::size_type basic_string<_CharT, _Traits, _Alloc>:: _Rep::_S_max_size = (((npos - sizeof(_Rep_base))/sizeof(_CharT)) - 1) / 4; template<typename _CharT, typename _Traits, typename _Alloc> - const _CharT + const _CharT basic_string<_CharT, _Traits, _Alloc>:: _Rep::_S_terminal = _CharT(); @@ -94,13 +94,13 @@ namespace std _CharT __buf[100]; size_type __len = 0; while (__beg != __end && __len < sizeof(__buf) / sizeof(_CharT)) - { - __buf[__len++] = *__beg; + { + __buf[__len++] = *__beg; ++__beg; } _Rep* __r = _Rep::_S_create(__len, size_type(0), __a); traits_type::copy(__r->_M_refdata(), __buf, __len); - try + try { while (__beg != __end) { @@ -108,36 +108,36 @@ namespace std { // Allocate more space. _Rep* __another = _Rep::_S_create(__len + 1, __len, __a); - traits_type::copy(__another->_M_refdata(), + traits_type::copy(__another->_M_refdata(), __r->_M_refdata(), __len); __r->_M_destroy(__a); __r = __another; } - __r->_M_refdata()[__len++] = *__beg; + __r->_M_refdata()[__len++] = *__beg; ++__beg; } } - catch(...) + catch(...) { - __r->_M_destroy(__a); + __r->_M_destroy(__a); __throw_exception_again; } __r->_M_length = __len; __r->_M_refdata()[__len] = _Rep::_S_terminal; // grrr. return __r->_M_refdata(); } - + template<typename _CharT, typename _Traits, typename _Alloc> template <typename _InIterator> _CharT* basic_string<_CharT, _Traits, _Alloc>:: - _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a, + _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a, forward_iterator_tag) { if (__beg == __end && __a == _Alloc()) return _S_empty_rep()._M_refdata(); - // NB: Not required, but considered best practice. + // NB: Not required, but considered best practice. if (__builtin_expect(__is_null_pointer(__beg), 0)) __throw_logic_error(__N("basic_string::_S_construct NULL not valid")); @@ -145,11 +145,11 @@ namespace std __end)); // Check for out_of_range and length_error exceptions. _Rep* __r = _Rep::_S_create(__dnew, size_type(0), __a); - try + try { _S_copy_chars(__r->_M_refdata(), __beg, __end); } - catch(...) - { - __r->_M_destroy(__a); + catch(...) + { + __r->_M_destroy(__a); __throw_exception_again; } __r->_M_length = __dnew; @@ -167,8 +167,8 @@ namespace std // Check for out_of_range and length_error exceptions. _Rep* __r = _Rep::_S_create(__n, size_type(0), __a); - if (__n) - traits_type::assign(__r->_M_refdata(), __n, __c); + if (__n) + traits_type::assign(__r->_M_refdata(), __n, __c); __r->_M_length = __n; __r->_M_refdata()[__n] = _Rep::_S_terminal; // grrr @@ -187,7 +187,7 @@ namespace std basic_string(const _Alloc& __a) : _M_dataplus(_S_construct(size_type(), _CharT(), __a), __a) { } - + template<typename _CharT, typename _Traits, typename _Alloc> basic_string<_CharT, _Traits, _Alloc>:: basic_string(const basic_string& __str, size_type __pos, size_type __n) @@ -230,7 +230,7 @@ namespace std : _M_dataplus(_S_construct(__n, __c, __a), __a) { } - // TBD: DPG annotate + // TBD: DPG annotate template<typename _CharT, typename _Traits, typename _Alloc> template<typename _InputIterator> basic_string<_CharT, _Traits, _Alloc>:: @@ -313,7 +313,7 @@ namespace std return *this; } } - + template<typename _CharT, typename _Traits, typename _Alloc> basic_string<_CharT, _Traits, _Alloc>& basic_string<_CharT, _Traits, _Alloc>:: @@ -350,7 +350,7 @@ namespace std return _M_replace_safe(__pos, __n1, __tmp._M_data(), __n2); } } - + template<typename _CharT, typename _Traits, typename _Alloc> void basic_string<_CharT, _Traits, _Alloc>::_Rep:: @@ -369,7 +369,7 @@ namespace std { if (_M_rep() == &_S_empty_rep()) return; - if (_M_rep()->_M_is_shared()) + if (_M_rep()->_M_is_shared()) _M_mutate(0, 0, 0); _M_rep()->_M_set_leaked(); } @@ -383,7 +383,7 @@ namespace std const size_type __new_size = __old_size + __len2 - __len1; const _CharT* __src = _M_data() + __pos + __len1; const size_type __how_much = __old_size - __pos - __len1; - + if (_M_rep() == &_S_empty_rep() || _M_rep()->_M_is_shared() || __new_size > capacity()) { @@ -410,7 +410,7 @@ namespace std _M_data()[__new_size] = _Rep::_S_terminal; // grrr. (per 21.3.4) // You cannot leave those LWG people alone for a second. } - + template<typename _CharT, typename _Traits, typename _Alloc> void basic_string<_CharT, _Traits, _Alloc>::reserve(size_type __res) @@ -428,13 +428,13 @@ namespace std _M_data(__tmp); } } - + template<typename _CharT, typename _Traits, typename _Alloc> void basic_string<_CharT, _Traits, _Alloc>::swap(basic_string& __s) { - if (_M_rep()->_M_is_leaked()) + if (_M_rep()->_M_is_leaked()) _M_rep()->_M_set_sharable(); - if (__s._M_rep()->_M_is_leaked()) + if (__s._M_rep()->_M_is_leaked()) __s._M_rep()->_M_set_sharable(); if (this->get_allocator() == __s.get_allocator()) { @@ -443,11 +443,11 @@ namespace std __s._M_data(__tmp); } // The code below can usually be optimized away. - else + else { const basic_string __tmp1(_M_ibegin(), _M_iend(), __s.get_allocator()); - const basic_string __tmp2(__s._M_ibegin(), __s._M_iend(), + const basic_string __tmp2(__s._M_ibegin(), __s._M_iend(), this->get_allocator()); *this = __tmp2; __s = __tmp1; @@ -504,7 +504,7 @@ namespace std const size_type __page_capacity = ((__pagesize - __malloc_header_size - sizeof(_Rep) - sizeof(_CharT)) / sizeof(_CharT)); - + if (__capacity > __old_capacity && __capacity < 2 * __old_capacity && __capacity > __page_capacity) __capacity = 2 * __old_capacity; @@ -558,7 +558,7 @@ namespace std __r->_M_refdata()[this->_M_length] = _Rep::_S_terminal; return __r->_M_refdata(); } - + template<typename _CharT, typename _Traits, typename _Alloc> void basic_string<_CharT, _Traits, _Alloc>::resize(size_type __n, _CharT __c) @@ -577,7 +577,7 @@ namespace std template<typename _InputIterator> basic_string<_CharT, _Traits, _Alloc>& basic_string<_CharT, _Traits, _Alloc>:: - _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1, + _M_replace_dispatch(iterator __i1, iterator __i2, _InputIterator __k1, _InputIterator __k2, __false_type) { const basic_string __s(__k1, __k2); @@ -720,16 +720,16 @@ namespace std { __pos = std::min(size_type(__size - __n), __pos); const _CharT* __data = _M_data(); - do + do { if (traits_type::compare(__data + __pos, __s, __n) == 0) return __pos; - } + } while (__pos-- > 0); } return npos; } - + template<typename _CharT, typename _Traits, typename _Alloc> typename basic_string<_CharT, _Traits, _Alloc>::size_type basic_string<_CharT, _Traits, _Alloc>:: @@ -746,7 +746,7 @@ namespace std } return npos; } - + template<typename _CharT, typename _Traits, typename _Alloc> typename basic_string<_CharT, _Traits, _Alloc>::size_type basic_string<_CharT, _Traits, _Alloc>:: @@ -761,7 +761,7 @@ namespace std } return npos; } - + template<typename _CharT, typename _Traits, typename _Alloc> typename basic_string<_CharT, _Traits, _Alloc>::size_type basic_string<_CharT, _Traits, _Alloc>:: @@ -770,19 +770,19 @@ namespace std __glibcxx_requires_string_len(__s, __n); size_type __size = this->size(); if (__size && __n) - { - if (--__size > __pos) + { + if (--__size > __pos) __size = __pos; do { if (traits_type::find(__s, __n, _M_data()[__size])) return __size; - } + } while (__size-- != 0); } return npos; } - + template<typename _CharT, typename _Traits, typename _Alloc> typename basic_string<_CharT, _Traits, _Alloc>::size_type basic_string<_CharT, _Traits, _Alloc>:: @@ -817,11 +817,11 @@ namespace std { if (--__size > __pos) __size = __pos; - do + do { if (!traits_type::find(__s, __n, _M_data()[__size])) return __size; - } + } while (__size--); } return npos; @@ -836,17 +836,17 @@ namespace std if (__size) { if (--__size > __pos) - __size = __pos; + __size = __pos; do { if (!traits_type::eq(_M_data()[__size], __c)) return __size; - } + } while (__size--); } return npos; } - + template<typename _CharT, typename _Traits, typename _Alloc> int basic_string<_CharT, _Traits, _Alloc>:: @@ -873,7 +873,7 @@ namespace std __n1 = _M_limit(__pos1, __n1); __n2 = __str._M_limit(__pos2, __n2); const size_type __len = std::min(__n1, __n2); - int __r = traits_type::compare(_M_data() + __pos1, + int __r = traits_type::compare(_M_data() + __pos1, __str.data() + __pos2, __len); if (!__r) __r = __n1 - __n2; @@ -914,7 +914,7 @@ namespace std template<typename _CharT, typename _Traits, typename _Alloc> int basic_string <_CharT, _Traits, _Alloc>:: - compare(size_type __pos, size_type __n1, const _CharT* __s, + compare(size_type __pos, size_type __n1, const _CharT* __s, size_type __n2) const { __glibcxx_requires_string_len(__s, __n2); @@ -928,36 +928,36 @@ namespace std } // Inhibit implicit instantiations for required instantiations, - // which are defined via explicit instantiations elsewhere. + // which are defined via explicit instantiations elsewhere. // NB: This syntax is a GNU extension. #if _GLIBCXX_EXTERN_TEMPLATE extern template class basic_string<char>; - extern template - basic_istream<char>& + extern template + basic_istream<char>& operator>>(basic_istream<char>&, string&); - extern template - basic_ostream<char>& + extern template + basic_ostream<char>& operator<<(basic_ostream<char>&, const string&); - extern template - basic_istream<char>& + extern template + basic_istream<char>& getline(basic_istream<char>&, string&, char); - extern template - basic_istream<char>& + extern template + basic_istream<char>& getline(basic_istream<char>&, string&); #ifdef _GLIBCXX_USE_WCHAR_T extern template class basic_string<wchar_t>; - extern template - basic_istream<wchar_t>& + extern template + basic_istream<wchar_t>& operator>>(basic_istream<wchar_t>&, wstring&); - extern template - basic_ostream<wchar_t>& + extern template + basic_ostream<wchar_t>& operator<<(basic_ostream<wchar_t>&, const wstring&); - extern template - basic_istream<wchar_t>& + extern template + basic_istream<wchar_t>& getline(basic_istream<wchar_t>&, wstring&, wchar_t); - extern template - basic_istream<wchar_t>& + extern template + basic_istream<wchar_t>& getline(basic_istream<wchar_t>&, wstring&); #endif #endif diff --git a/libstdc++-v3/include/bits/boost_concept_check.h b/libstdc++-v3/include/bits/boost_concept_check.h index b8bce64b8c4..70037eb1c3a 100644 --- a/libstdc++-v3/include/bits/boost_concept_check.h +++ b/libstdc++-v3/include/bits/boost_concept_check.h @@ -87,7 +87,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; template <class _Tp> struct _IntegerConcept { - void __constraints() { + void __constraints() { this->__error_type_must_be_an_integer_type(); } }; @@ -103,7 +103,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; template <class _Tp> struct _SignedIntegerConcept { - void __constraints() { + void __constraints() { this->__error_type_must_be_a_signed_integer_type(); } }; @@ -114,7 +114,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; template <class _Tp> struct _UnsignedIntegerConcept { - void __constraints() { + void __constraints() { this->__error_type_must_be_an_unsigned_integer_type(); } }; @@ -312,7 +312,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; template <class _Func, class _Arg> struct _UnaryFunctionConcept<_Func, void, _Arg> { - void __constraints() { + void __constraints() { __f(__arg); // require operator() } _Func __f; @@ -322,7 +322,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; template <class _Func, class _Return, class _First, class _Second> struct _BinaryFunctionConcept { - void __constraints() { + void __constraints() { __r = __f(__first, __second); // require operator() } _Func __f; @@ -366,7 +366,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; // use this when functor is used inside a container class like std::set template <class _Func, class _First, class _Second> struct _Const_BinaryPredicateConcept { - void __constraints() { + void __constraints() { __const_constraints(__f); } void __const_constraints(const _Func& __fun) { @@ -560,7 +560,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; typedef typename _Container::reference _Reference; typedef typename _Container::iterator _Iterator; typedef typename _Container::pointer _Pointer; - + void __constraints() { __function_requires< _ContainerConcept<_Container> >(); __function_requires< _AssignableConcept<_Value_type> >(); @@ -582,7 +582,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; typedef typename _ForwardContainer::const_iterator _Const_iterator; __function_requires< _ForwardIteratorConcept<_Const_iterator> >(); } - }; + }; template <class _ForwardContainer> struct _Mutable_ForwardContainerConcept @@ -593,7 +593,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; typedef typename _ForwardContainer::iterator _Iterator; __function_requires< _Mutable_ForwardIteratorConcept<_Iterator> >(); } - }; + }; template <class _ReversibleContainer> struct _ReversibleContainerConcept @@ -693,7 +693,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; __function_requires< _Mutable_ForwardContainerConcept<_Sequence> >(); __function_requires< _DefaultConstructibleConcept<_Sequence> >(); - _Sequence + _Sequence __c(__n) _IsUnused, __c2(__n, __t) _IsUnused, __c3(__first, __last) _IsUnused; @@ -758,7 +758,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; __function_requires< _ForwardContainerConcept<_AssociativeContainer> >(); __function_requires< _DefaultConstructibleConcept<_AssociativeContainer> >(); - + __i = __c.find(__k); __r = __c.equal_range(__k); __c.erase(__k); @@ -789,9 +789,9 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; void __constraints() { __function_requires< _AssociativeContainerConcept<_UniqueAssociativeContainer> >(); - + _UniqueAssociativeContainer __c(__first, __last); - + __pos_flag = __c.insert(__t); __c.insert(__first, __last); } @@ -808,7 +808,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; _AssociativeContainerConcept<_MultipleAssociativeContainer> >(); _MultipleAssociativeContainer __c(__first, __last); - + __pos = __c.insert(__t); __c.insert(__first, __last); @@ -855,7 +855,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; __function_requires< _ReversibleContainerConcept<_SortedAssociativeContainer> >(); - _SortedAssociativeContainer + _SortedAssociativeContainer __c(__kc) _IsUnused, __c2(__first, __last) _IsUnused, __c3(__first, __last, __kc) _IsUnused; @@ -863,7 +863,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; __p = __c.upper_bound(__k); __p = __c.lower_bound(__k); __r = __c.equal_range(__k); - + __c.insert(__p, __t); } void __const_constraints(const _SortedAssociativeContainer& __c) { diff --git a/libstdc++-v3/include/bits/char_traits.h b/libstdc++-v3/include/bits/char_traits.h index 34479755e85..323fdfb47c0 100644 --- a/libstdc++-v3/include/bits/char_traits.h +++ b/libstdc++-v3/include/bits/char_traits.h @@ -50,12 +50,12 @@ namespace __gnu_cxx { /** * @brief Mapping from character type to associated types. - * + * * * @note This is an implementation class for the generic version * of char_traits. It defines int_type, off_type, pos_type, and * state_type. By default these are unsigned long, streamoff, - * streampos, and mbstate_t. Users who need a different set of + * streampos, and mbstate_t. Users who need a different set of * types, but who don't need to change the definitions of any function * defined in char_traits, can specialize __gnu_cxx::_Char_types * while leaving __gnu_cxx::char_traits alone. */ @@ -91,54 +91,54 @@ namespace __gnu_cxx typedef typename _Char_types<_CharT>::pos_type pos_type; typedef typename _Char_types<_CharT>::off_type off_type; typedef typename _Char_types<_CharT>::state_type state_type; - - static void + + static void assign(char_type& __c1, const char_type& __c2) { __c1 = __c2; } - static bool + static bool eq(const char_type& __c1, const char_type& __c2) { return __c1 == __c2; } - static bool + static bool lt(const char_type& __c1, const char_type& __c2) { return __c1 < __c2; } - static int + static int compare(const char_type* __s1, const char_type* __s2, std::size_t __n); static std::size_t length(const char_type* __s); - static const char_type* + static const char_type* find(const char_type* __s, std::size_t __n, const char_type& __a); - static char_type* + static char_type* move(char_type* __s1, const char_type* __s2, std::size_t __n); - static char_type* + static char_type* copy(char_type* __s1, const char_type* __s2, std::size_t __n); - static char_type* + static char_type* assign(char_type* __s, std::size_t __n, char_type __a); - static char_type + static char_type to_char_type(const int_type& __c) { return static_cast<char_type>(__c); } - static int_type + static int_type to_int_type(const char_type& __c) { return static_cast<int_type>(__c); } - static bool + static bool eq_int_type(const int_type& __c1, const int_type& __c2) { return __c1 == __c2; } - static int_type + static int_type eof() { return static_cast<int_type>(EOF); } - static int_type + static int_type not_eof(const int_type& __c) { return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); } }; @@ -168,7 +168,7 @@ namespace __gnu_cxx } template<typename _CharT> - const typename char_traits<_CharT>::char_type* + const typename char_traits<_CharT>::char_type* char_traits<_CharT>:: find(const char_type* __s, std::size_t __n, const char_type& __a) { @@ -188,7 +188,7 @@ namespace __gnu_cxx } template<typename _CharT> - typename char_traits<_CharT>::char_type* + typename char_traits<_CharT>::char_type* char_traits<_CharT>:: copy(char_type* __s1, const char_type* __s2, std::size_t __n) { @@ -197,7 +197,7 @@ namespace __gnu_cxx } template<typename _CharT> - typename char_traits<_CharT>::char_type* + typename char_traits<_CharT>::char_type* char_traits<_CharT>:: assign(char_type* __s, std::size_t __n, char_type __a) { @@ -206,7 +206,7 @@ namespace __gnu_cxx } } -namespace std +namespace std { // 21.1 /** @@ -237,19 +237,19 @@ namespace std typedef streamoff off_type; typedef mbstate_t state_type; - static void + static void assign(char_type& __c1, const char_type& __c2) { __c1 = __c2; } - static bool + static bool eq(const char_type& __c1, const char_type& __c2) { return __c1 == __c2; } - static bool + static bool lt(const char_type& __c1, const char_type& __c2) { return __c1 < __c2; } - static int + static int compare(const char_type* __s1, const char_type* __s2, size_t __n) { return memcmp(__s1, __s2, __n); } @@ -257,40 +257,40 @@ namespace std length(const char_type* __s) { return strlen(__s); } - static const char_type* + static const char_type* find(const char_type* __s, size_t __n, const char_type& __a) { return static_cast<const char_type*>(memchr(__s, __a, __n)); } - static char_type* + static char_type* move(char_type* __s1, const char_type* __s2, size_t __n) { return static_cast<char_type*>(memmove(__s1, __s2, __n)); } - static char_type* + static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) { return static_cast<char_type*>(memcpy(__s1, __s2, __n)); } - static char_type* + static char_type* assign(char_type* __s, size_t __n, char_type __a) { return static_cast<char_type*>(memset(__s, __a, __n)); } - static char_type + static char_type to_char_type(const int_type& __c) { return static_cast<char_type>(__c); } // To keep both the byte 0xff and the eof symbol 0xffffffff // from ending up as 0xffffffff. - static int_type + static int_type to_int_type(const char_type& __c) { return static_cast<int_type>(static_cast<unsigned char>(__c)); } - static bool + static bool eq_int_type(const int_type& __c1, const int_type& __c2) { return __c1 == __c2; } - static int_type + static int_type eof() { return static_cast<int_type>(EOF); } - static int_type + static int_type not_eof(const int_type& __c) { return (__c == eof()) ? 0 : __c; } }; @@ -306,20 +306,20 @@ namespace std typedef streamoff off_type; typedef wstreampos pos_type; typedef mbstate_t state_type; - - static void + + static void assign(char_type& __c1, const char_type& __c2) { __c1 = __c2; } - static bool + static bool eq(const char_type& __c1, const char_type& __c2) { return __c1 == __c2; } - static bool + static bool lt(const char_type& __c1, const char_type& __c2) { return __c1 < __c2; } - static int + static int compare(const char_type* __s1, const char_type* __s2, size_t __n) { return wmemcmp(__s1, __s2, __n); } @@ -327,36 +327,36 @@ namespace std length(const char_type* __s) { return wcslen(__s); } - static const char_type* + static const char_type* find(const char_type* __s, size_t __n, const char_type& __a) { return wmemchr(__s, __a, __n); } - static char_type* + static char_type* move(char_type* __s1, const char_type* __s2, size_t __n) { return wmemmove(__s1, __s2, __n); } - static char_type* + static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) { return wmemcpy(__s1, __s2, __n); } - static char_type* + static char_type* assign(char_type* __s, size_t __n, char_type __a) { return wmemset(__s, __a, __n); } - static char_type + static char_type to_char_type(const int_type& __c) { return char_type(__c); } - static int_type + static int_type to_int_type(const char_type& __c) { return int_type(__c); } - static bool + static bool eq_int_type(const int_type& __c1, const int_type& __c2) { return __c1 == __c2; } - static int_type + static int_type eof() { return static_cast<int_type>(WEOF); } - static int_type + static int_type not_eof(const int_type& __c) { return eq_int_type(__c, eof()) ? 0 : __c; } }; @@ -368,7 +368,7 @@ namespace std _CharT _M_c; _Char_traits_match(_CharT const& __c) : _M_c(__c) { } - bool + bool operator()(_CharT const& __a) { return _Traits::eq(_M_c, __a); } }; } // namespace std diff --git a/libstdc++-v3/include/bits/codecvt.h b/libstdc++-v3/include/bits/codecvt.h index 33d2b95e35e..56b55539265 100644 --- a/libstdc++-v3/include/bits/codecvt.h +++ b/libstdc++-v3/include/bits/codecvt.h @@ -71,16 +71,16 @@ * functions. */ template<typename _InternT, typename _ExternT, typename _StateT> - class __codecvt_abstract_base + class __codecvt_abstract_base : public locale::facet, public codecvt_base { public: // Types: typedef codecvt_base::result result; - typedef _InternT intern_type; - typedef _ExternT extern_type; - typedef _StateT state_type; - + typedef _InternT intern_type; + typedef _ExternT extern_type; + typedef _StateT state_type; + // 22.2.1.5.1 codecvt members /** * @brief Convert from internal to external character set. @@ -118,13 +118,13 @@ * @return codecvt_base::result. */ result - out(state_type& __state, const intern_type* __from, + out(state_type& __state, const intern_type* __from, const intern_type* __from_end, const intern_type*& __from_next, - extern_type* __to, extern_type* __to_end, + extern_type* __to, extern_type* __to_end, extern_type*& __to_next) const - { - return this->do_out(__state, __from, __from_end, __from_next, - __to, __to_end, __to_next); + { + return this->do_out(__state, __from, __from_end, __from_next, + __to, __to_end, __to_next); } /** @@ -197,20 +197,20 @@ * @return codecvt_base::result. */ result - in(state_type& __state, const extern_type* __from, + in(state_type& __state, const extern_type* __from, const extern_type* __from_end, const extern_type*& __from_next, - intern_type* __to, intern_type* __to_end, + intern_type* __to, intern_type* __to_end, intern_type*& __to_next) const - { + { return this->do_in(__state, __from, __from_end, __from_next, - __to, __to_end, __to_next); + __to, __to_end, __to_next); } - int + int encoding() const throw() { return this->do_encoding(); } - bool + bool always_noconv() const throw() { return this->do_always_noconv(); } @@ -219,15 +219,15 @@ const extern_type* __end, size_t __max) const { return this->do_length(__state, __from, __end, __max); } - int + int max_length() const throw() { return this->do_max_length(); } protected: - explicit + explicit __codecvt_abstract_base(size_t __refs = 0) : locale::facet(__refs) { } - virtual + virtual ~__codecvt_abstract_base() { } /** @@ -238,92 +238,92 @@ * the value returned. @see out for more information. */ virtual result - do_out(state_type& __state, const intern_type* __from, + do_out(state_type& __state, const intern_type* __from, const intern_type* __from_end, const intern_type*& __from_next, extern_type* __to, extern_type* __to_end, extern_type*& __to_next) const = 0; virtual result - do_unshift(state_type& __state, extern_type* __to, + do_unshift(state_type& __state, extern_type* __to, extern_type* __to_end, extern_type*& __to_next) const = 0; - + virtual result - do_in(state_type& __state, const extern_type* __from, - const extern_type* __from_end, const extern_type*& __from_next, - intern_type* __to, intern_type* __to_end, + do_in(state_type& __state, const extern_type* __from, + const extern_type* __from_end, const extern_type*& __from_next, + intern_type* __to, intern_type* __to_end, intern_type*& __to_next) const = 0; - - virtual int + + virtual int do_encoding() const throw() = 0; - virtual bool + virtual bool do_always_noconv() const throw() = 0; - virtual int - do_length(state_type&, const extern_type* __from, + virtual int + do_length(state_type&, const extern_type* __from, const extern_type* __end, size_t __max) const = 0; - virtual int + virtual int do_max_length() const throw() = 0; }; // 22.2.1.5 Template class codecvt // NB: Generic, mostly useless implementation. template<typename _InternT, typename _ExternT, typename _StateT> - class codecvt + class codecvt : public __codecvt_abstract_base<_InternT, _ExternT, _StateT> { - public: + public: // Types: typedef codecvt_base::result result; - typedef _InternT intern_type; - typedef _ExternT extern_type; - typedef _StateT state_type; + typedef _InternT intern_type; + typedef _ExternT extern_type; + typedef _StateT state_type; protected: __c_locale _M_c_locale_codecvt; public: - static locale::id id; + static locale::id id; - explicit - codecvt(size_t __refs = 0) + explicit + codecvt(size_t __refs = 0) : __codecvt_abstract_base<_InternT, _ExternT, _StateT> (__refs) { } - explicit + explicit codecvt(__c_locale __cloc, size_t __refs = 0); protected: - virtual + virtual ~codecvt() { } virtual result - do_out(state_type& __state, const intern_type* __from, + do_out(state_type& __state, const intern_type* __from, const intern_type* __from_end, const intern_type*& __from_next, extern_type* __to, extern_type* __to_end, extern_type*& __to_next) const; virtual result - do_unshift(state_type& __state, extern_type* __to, + do_unshift(state_type& __state, extern_type* __to, extern_type* __to_end, extern_type*& __to_next) const; - + virtual result - do_in(state_type& __state, const extern_type* __from, - const extern_type* __from_end, const extern_type*& __from_next, - intern_type* __to, intern_type* __to_end, + do_in(state_type& __state, const extern_type* __from, + const extern_type* __from_end, const extern_type*& __from_next, + intern_type* __to, intern_type* __to_end, intern_type*& __to_next) const; - - virtual int + + virtual int do_encoding() const throw(); - virtual bool + virtual bool do_always_noconv() const throw(); - virtual int - do_length(state_type&, const extern_type* __from, + virtual int + do_length(state_type&, const extern_type* __from, const extern_type* __end, size_t __max) const; - virtual int + virtual int do_max_length() const throw(); }; @@ -332,14 +332,14 @@ // codecvt<char, char, mbstate_t> required specialization template<> - class codecvt<char, char, mbstate_t> + class codecvt<char, char, mbstate_t> : public __codecvt_abstract_base<char, char, mbstate_t> { - public: + public: // Types: - typedef char intern_type; - typedef char extern_type; - typedef mbstate_t state_type; + typedef char intern_type; + typedef char extern_type; + typedef mbstate_t state_type; protected: __c_locale _M_c_locale_codecvt; @@ -347,76 +347,76 @@ public: static locale::id id; - explicit + explicit codecvt(size_t __refs = 0); - explicit + explicit codecvt(__c_locale __cloc, size_t __refs = 0); protected: - virtual + virtual ~codecvt(); virtual result - do_out(state_type& __state, const intern_type* __from, + do_out(state_type& __state, const intern_type* __from, const intern_type* __from_end, const intern_type*& __from_next, extern_type* __to, extern_type* __to_end, extern_type*& __to_next) const; virtual result - do_unshift(state_type& __state, extern_type* __to, + do_unshift(state_type& __state, extern_type* __to, extern_type* __to_end, extern_type*& __to_next) const; virtual result - do_in(state_type& __state, const extern_type* __from, + do_in(state_type& __state, const extern_type* __from, const extern_type* __from_end, const extern_type*& __from_next, - intern_type* __to, intern_type* __to_end, + intern_type* __to, intern_type* __to_end, intern_type*& __to_next) const; - virtual int + virtual int do_encoding() const throw(); - virtual bool + virtual bool do_always_noconv() const throw(); - virtual int - do_length(state_type&, const extern_type* __from, + virtual int + do_length(state_type&, const extern_type* __from, const extern_type* __end, size_t __max) const; - virtual int + virtual int do_max_length() const throw(); }; #ifdef _GLIBCXX_USE_WCHAR_T // codecvt<wchar_t, char, mbstate_t> required specialization template<> - class codecvt<wchar_t, char, mbstate_t> + class codecvt<wchar_t, char, mbstate_t> : public __codecvt_abstract_base<wchar_t, char, mbstate_t> { public: // Types: - typedef wchar_t intern_type; - typedef char extern_type; - typedef mbstate_t state_type; + typedef wchar_t intern_type; + typedef char extern_type; + typedef mbstate_t state_type; protected: __c_locale _M_c_locale_codecvt; public: - static locale::id id; + static locale::id id; - explicit + explicit codecvt(size_t __refs = 0); - explicit + explicit codecvt(__c_locale __cloc, size_t __refs = 0); protected: - virtual + virtual ~codecvt(); virtual result - do_out(state_type& __state, const intern_type* __from, + do_out(state_type& __state, const intern_type* __from, const intern_type* __from_end, const intern_type*& __from_next, extern_type* __to, extern_type* __to_end, extern_type*& __to_next) const; @@ -433,17 +433,17 @@ intern_type* __to, intern_type* __to_end, intern_type*& __to_next) const; - virtual + virtual int do_encoding() const throw(); - virtual + virtual bool do_always_noconv() const throw(); - virtual + virtual int do_length(state_type&, const extern_type* __from, const extern_type* __end, size_t __max) const; - virtual int + virtual int do_max_length() const throw(); }; #endif //_GLIBCXX_USE_WCHAR_T @@ -453,19 +453,19 @@ class codecvt_byname : public codecvt<_InternT, _ExternT, _StateT> { public: - explicit - codecvt_byname(const char* __s, size_t __refs = 0) + explicit + codecvt_byname(const char* __s, size_t __refs = 0) : codecvt<_InternT, _ExternT, _StateT>(__refs) - { + { if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) { _S_destroy_c_locale(this->_M_c_locale_codecvt); - _S_create_c_locale(this->_M_c_locale_codecvt, __s); + _S_create_c_locale(this->_M_c_locale_codecvt, __s); } } protected: - virtual + virtual ~codecvt_byname() { } }; diff --git a/libstdc++-v3/include/bits/concurrence.h b/libstdc++-v3/include/bits/concurrence.h index 68b9ab7a9f6..fe67881c76b 100644 --- a/libstdc++-v3/include/bits/concurrence.h +++ b/libstdc++-v3/include/bits/concurrence.h @@ -27,7 +27,7 @@ // the GNU General Public License. This exception does not however // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. - + #ifndef _CONCURRENCE #define _CONCURRENCE 1 @@ -47,8 +47,8 @@ __GTHREAD_MUTEX_INIT_FUNCTION(&NAME) # define __glibcxx_mutex_unlock(LOCK) __gthread_mutex_unlock(&LOCK) #else # define __glibcxx_mutex_define_initialized(NAME) -# define __glibcxx_mutex_lock(LOCK) -# define __glibcxx_mutex_unlock(LOCK) +# define __glibcxx_mutex_lock(LOCK) +# define __glibcxx_mutex_unlock(LOCK) #endif #endif diff --git a/libstdc++-v3/include/bits/cpp_type_traits.h b/libstdc++-v3/include/bits/cpp_type_traits.h index 00fe5606b89..7a0e65f4016 100644 --- a/libstdc++-v3/include/bits/cpp_type_traits.h +++ b/libstdc++-v3/include/bits/cpp_type_traits.h @@ -139,7 +139,7 @@ namespace std _M_type = 1 }; }; - + template<> struct __is_integer<char> { @@ -157,7 +157,7 @@ namespace std _M_type = 1 }; }; - + template<> struct __is_integer<unsigned char> { @@ -177,7 +177,7 @@ namespace std }; }; # endif - + template<> struct __is_integer<short> { diff --git a/libstdc++-v3/include/bits/demangle.h b/libstdc++-v3/include/bits/demangle.h index 2c240162e90..021276ae21a 100644 --- a/libstdc++-v3/include/bits/demangle.h +++ b/libstdc++-v3/include/bits/demangle.h @@ -73,7 +73,7 @@ namespace __gnu_cxx int M_start_pos; substitution_nt M_type; int M_number_of_prefixes; - + substitution_st(int start_pos, substitution_nt type, int number_of_prefixes) @@ -209,7 +209,7 @@ namespace __gnu_cxx class qualifier_list { typedef typename Allocator::template rebind<char>::other - char_Allocator; + char_Allocator; typedef std::basic_string<char, std::char_traits<char>, char_Allocator> string_type; @@ -250,7 +250,7 @@ namespace __gnu_cxx void add_qualifier_start(param_qualifier_nt param_qualifier, - int start_pos, + int start_pos, string_type optional_type, int inside_substitution) { M_qualifier_starts. @@ -259,7 +259,7 @@ namespace __gnu_cxx void decode_qualifiers(string_type& prefix, - string_type& postfix, + string_type& postfix, bool member_function_pointer_qualifiers) const; bool @@ -307,7 +307,7 @@ namespace __gnu_cxx // Use (void) instead of (): int f(void) static unsigned int const style_literal = 2; - // Default behaviour: (long)13, + // Default behaviour: (long)13, // (unsigned long long)19 // Use extensions 'u', 'l' and 'll' for integral // literals (as in template arguments): 13l, 19ull @@ -352,7 +352,7 @@ namespace __gnu_cxx { friend class qualifier_list<Allocator>; typedef typename Allocator::template rebind<char>::other - char_Allocator; + char_Allocator; typedef std::basic_string<char, std::char_traits<char>, char_Allocator> string_type; @@ -498,7 +498,7 @@ namespace __gnu_cxx int n = M_substitutions_pos.size() - 1; if (n > 0) substitution_name += (n <= 10) ? (char)(n + '0' - 1) - : (char)(n + 'A' - 11); + : (char)(n + 'A' - 11); substitution_name += '_'; string_type subst; int saved_pos = M_pos; @@ -1051,56 +1051,56 @@ namespace __gnu_cxx } // <operator-name> ::= - // nw # new + // nw # new // na # new[] - // dl # delete - // da # delete[] + // dl # delete + // da # delete[] // ps # + (unary) - // ng # - (unary) - // ad # & (unary) - // de # * (unary) - // co # ~ - // pl # + - // mi # - - // ml # * - // dv # / - // rm # % - // an # & - // or # | - // eo # ^ - // aS # = - // pL # += - // mI # -= - // mL # *= - // dV # /= - // rM # %= - // aN # &= - // oR # |= - // eO # ^= - // ls # << - // rs # >> - // lS # <<= - // rS # >>= - // eq # == - // ne # != - // lt # < - // gt # > - // le # <= - // ge # >= - // nt # ! - // aa # && - // oo # || - // pp # ++ - // mm # -- - // cm # , - // pm # ->* - // pt # -> - // cl # () - // ix # [] + // ng # - (unary) + // ad # & (unary) + // de # * (unary) + // co # ~ + // pl # + + // mi # - + // ml # * + // dv # / + // rm # % + // an # & + // or # | + // eo # ^ + // aS # = + // pL # += + // mI # -= + // mL # *= + // dV # /= + // rM # %= + // aN # &= + // oR # |= + // eO # ^= + // ls # << + // rs # >> + // lS # <<= + // rS # >>= + // eq # == + // ne # != + // lt # < + // gt # > + // le # <= + // ge # >= + // nt # ! + // aa # && + // oo # || + // pp # ++ + // mm # -- + // cm # , + // pm # ->* + // pt # -> + // cl # () + // ix # [] // qu # ? // st # sizeof (a type) // sz # sizeof (an expression) - // cv <type> # (cast) + // cv <type> # (cast) // v <digit> <source-name> # vendor extended operator // // Symbol operator codes exist of two characters, we need to find a @@ -1579,15 +1579,15 @@ namespace __gnu_cxx // <builtin-type> # Starts with a lower case character != r. // <function-type> # Starts with F // <class-enum-type> # Starts with N, S, C, D, Z, a digit or a lower - // # case character. Since a lower case character - // # would be an operator name, that would be an - // # error. The S is a substitution or St - // # (::std::). A 'C' would be a constructor and - // # thus also an error. + // # case character. Since a lower case character + // # would be an operator name, that would be an + // # error. The S is a substitution or St + // # (::std::). A 'C' would be a constructor and + // # thus also an error. // <template-param> # Starts with T // <substitution> # Starts with S // <template-template-param> <template-args> # Starts with T or S, - // # equivalent with the above. + // # equivalent with the above. // // <array-type> # Starts with A // <pointer-to-member-type> # Starts with M @@ -1596,8 +1596,8 @@ namespace __gnu_cxx // R <type> # reference-to # Starts with R // C <type> # complex (C 2000) # Starts with C // G <type> # imaginary (C 2000)# Starts with G - // U <source-name> <type> # vendor extended type qualifier, - // # starts with U + // U <source-name> <type> # vendor extended type qualifier, + // # starts with U // // <template-template-param> ::= <template-param> // ::= <substitution> @@ -1613,9 +1613,9 @@ namespace __gnu_cxx // <I> is the array index. // Substitutions: // <Q>M<C><Q2>F<R><B>E ==> R (C::*Q)B Q2 "<C>", "F<R><B>E" - // (<R> and <B> recursive), - // "M<C><Q2>F<R><B>E". - // <Q>F<R><B>E ==> R (Q)B "<R>", "<B>" (<B> recursive) + // (<R> and <B> recursive), + // "M<C><Q2>F<R><B>E". + // <Q>F<R><B>E ==> R (Q)B "<R>", "<B>" (<B> recursive) // and "F<R><B>E". // // Note that if <R> has postfix qualifiers (an array or function), then @@ -1623,14 +1623,14 @@ namespace __gnu_cxx // <Q>FPA<R><B>E ==> R (*(Q)B) [], where the PA added the prefix // "(*" and the postfix ") []". // - // <Q>G<T> ==> imaginary T Q "<T>", "G<T>" (<T> recursive). - // <Q>C<T> ==> complex T Q "<T>", "C<T>" (<T> recursive). - // <Q><T> ==> T Q "<T>" (<T> recursive). + // <Q>G<T> ==> imaginary T Q "<T>", "G<T>" (<T> recursive). + // <Q>C<T> ==> complex T Q "<T>", "C<T>" (<T> recursive). + // <Q><T> ==> T Q "<T>" (<T> recursive). // // where <Q> is any of: // - // <Q>P ==> *Q "P..." - // <Q>R ==> &Q "R..." + // <Q>P ==> *Q "P..." + // <Q>R ==> &Q "R..." // <Q>[K|V|r]+ ==> [ const| volatile| restrict]+Q "KVr..." // <Q>U<S> ==> SQ "U<S>..." // <Q>M<C> ==> C::*Q "M<C>..." (<C> recurs.) @@ -1641,7 +1641,7 @@ namespace __gnu_cxx // A<I2>A<I> ==> [I2][I] // If <Q> ends on [KVr]+, which can happen in combination with // substitutions only, then special handling is required, see below. - // + // // A <substitution> is handled with an input position switch during which // new substitutions are turned off. Because recursive handling of types // (and therefore the order in which substitutions must be generated) must @@ -1653,7 +1653,7 @@ namespace __gnu_cxx // // The following comment was for the demangling of g++ version 3.0.x. The // mangling (and I believe even the ABI description) have been fixed now - // (as of g++ version 3.1). + // (as of g++ version 3.1). // // g++ 3.0.x only: // The ABI specifies for pointer-to-member function types the format @@ -1696,7 +1696,7 @@ namespace __gnu_cxx static int const cvq_A = 8; // Saw at least one A static int const cvq_last = 16; // No remaining qualifiers. static int const cvq_A_cnt = 32; // Bit 5 and higher represent the - // number of A's in the series. + // number of A's in the series. // In the function below, iter_array points to the first (right most) // A in the series, if any. template<typename Allocator> @@ -2011,9 +2011,9 @@ namespace __gnu_cxx } if (!failure) { - // <Q>G<T> ==> imaginary T Q + // <Q>G<T> ==> imaginary T Q // substitutions: "<T>", "G<T>" (<T> recursive). - // <Q>C<T> ==> complex T Q + // <Q>C<T> ==> complex T Q // substitutions: "<T>", "C<T>" (<T> recursive). if (current() == 'C' || current() == 'G') { @@ -2034,8 +2034,8 @@ namespace __gnu_cxx bool extern_C = (next() == 'Y'); if (extern_C) eat_current(); - - // <Q>F<R><B>E ==> R (Q)B + + // <Q>F<R><B>E ==> R (Q)B // substitution: "<R>", "<B>" (<B> recursive) and "F<R><B>E". // Return type. @@ -2143,7 +2143,7 @@ namespace __gnu_cxx case '7': case '8': case '9': - // <Q><T> ==> T Q + // <Q><T> ==> T Q // substitutions: "<T>" (<T> recursive). if (!decode_class_enum_type(prefix)) { @@ -2161,7 +2161,7 @@ namespace __gnu_cxx qualifiers->printing_suppressed(); break; default: - // <Q><T> ==> T Q + // <Q><T> ==> T Q // substitutions: "<T>" (<T> recursive). if (!decode_builtin_type(prefix)) { @@ -2246,7 +2246,7 @@ namespace __gnu_cxx { // substitution: "<template-prefix> <template-args>". add_substitution(substitution_start, nested_name_prefix, - number_of_prefixes); + number_of_prefixes); } } else @@ -2348,7 +2348,7 @@ namespace __gnu_cxx // <unqualified-name> ::= <operator-name> # Starts with lower case. // ::= <ctor-dtor-name> # Starts with 'C' or 'D'. - // ::= <source-name> # Starts with a digit. + // ::= <source-name> # Starts with a digit. // template<typename Allocator> bool @@ -2446,8 +2446,8 @@ namespace __gnu_cxx // <unscoped-template-name> <template-args> # idem // <local-name> # Starts with 'Z' // <unscoped-name> # Starts with 'S', 'C', 'D', - // # a digit or a lower case - // # character. + // # a digit or a lower case + // # character. // // <unscoped-template-name> ::= <unscoped-name> // ::= <substitution> @@ -2488,7 +2488,7 @@ namespace __gnu_cxx // <call-offset> ::= h <nv-offset> _ // ::= v <v-offset> _ - // <nv-offset> ::= <offset number> + // <nv-offset> ::= <offset number> // non-virtual base override // // <v-offset> ::= <offset number> _ <virtual offset number> @@ -2538,10 +2538,10 @@ namespace __gnu_cxx // TS <type> # typeinfo name (null-terminated // byte string). // GV <object name> # Guard variable for one-time - // initialization of static objects in - // a local scope. + // initialization of static objects in + // a local scope. // T <call-offset> <base encoding># base is the nominal target function - // of thunk. + // of thunk. // Tc <call-offset> <call-offset> <base encoding> # base is the nominal // target function of thunk; first // call-offset is 'this' adjustment; @@ -2629,8 +2629,8 @@ namespace __gnu_cxx // <encoding> ::= // <function name> <bare-function-type> # Starts with 'C', 'D', 'N', - // 'S', a digit or a lower case - // character. + // 'S', a digit or a lower case + // character. // <data name> # Idem. // <special-name> # Starts with 'T' or 'G'. template<typename Allocator> @@ -2691,7 +2691,7 @@ namespace __gnu_cxx struct demangle { typedef typename Allocator::template rebind<char>::other char_Allocator; - typedef std::basic_string<char, std::char_traits<char>, char_Allocator> + typedef std::basic_string<char, std::char_traits<char>, char_Allocator> string_type; static string_type symbol(char const* in, demangler::implementation_details const& id); @@ -2769,7 +2769,7 @@ namespace __gnu_cxx || demangler_session.remaining_input_characters()) { // Failure to demangle, return the mangled name. - result = input; + result = input; } } return result; diff --git a/libstdc++-v3/include/bits/deque.tcc b/libstdc++-v3/include/bits/deque.tcc index 2f26edfb3af..a30c8516684 100644 --- a/libstdc++-v3/include/bits/deque.tcc +++ b/libstdc++-v3/include/bits/deque.tcc @@ -62,7 +62,7 @@ #define _DEQUE_TCC 1 namespace __gnu_norm -{ +{ template <typename _Tp, typename _Alloc> deque<_Tp,_Alloc>& deque<_Tp,_Alloc>:: @@ -82,10 +82,10 @@ namespace __gnu_norm } } return *this; - } - + } + template <typename _Tp, typename _Alloc> - typename deque<_Tp,_Alloc>::iterator + typename deque<_Tp,_Alloc>::iterator deque<_Tp,_Alloc>:: insert(iterator position, const value_type& __x) { @@ -104,9 +104,9 @@ namespace __gnu_norm else return _M_insert_aux(position, __x); } - + template <typename _Tp, typename _Alloc> - typename deque<_Tp,_Alloc>::iterator + typename deque<_Tp,_Alloc>::iterator deque<_Tp,_Alloc>:: erase(iterator __position) { @@ -125,9 +125,9 @@ namespace __gnu_norm } return this->_M_start + __index; } - + template <typename _Tp, typename _Alloc> - typename deque<_Tp,_Alloc>::iterator + typename deque<_Tp,_Alloc>::iterator deque<_Tp,_Alloc>:: erase(iterator __first, iterator __last) { @@ -160,8 +160,8 @@ namespace __gnu_norm return this->_M_start + __elems_before; } } - - template <typename _Tp, typename _Alloc> + + template <typename _Tp, typename _Alloc> void deque<_Tp,_Alloc>:: clear() @@ -173,7 +173,7 @@ namespace __gnu_norm std::_Destroy(*__node, *__node + _S_buffer_size()); _M_deallocate_node(*__node); } - + if (this->_M_start._M_node != this->_M_finish._M_node) { std::_Destroy(this->_M_start._M_cur, this->_M_start._M_last); @@ -182,10 +182,10 @@ namespace __gnu_norm } else std::_Destroy(this->_M_start._M_cur, this->_M_finish._M_cur); - + this->_M_finish = this->_M_start; } - + template <typename _Tp, class _Alloc> template <typename _InputIterator> void @@ -201,7 +201,7 @@ namespace __gnu_norm else insert(end(), __first, __last); } - + template <typename _Tp, typename _Alloc> void deque<_Tp,_Alloc>:: @@ -232,14 +232,14 @@ namespace __gnu_norm catch(...) { _M_destroy_nodes(this->_M_finish._M_node + 1, - __new_finish._M_node + 1); + __new_finish._M_node + 1); __throw_exception_again; } } - else + else _M_insert_aux(__pos, __n, __x); } - + template <typename _Tp, typename _Alloc> void deque<_Tp,_Alloc>:: @@ -262,7 +262,7 @@ namespace __gnu_norm __throw_exception_again; } } - + template <typename _Tp, typename _Alloc> template <typename _InputIterator> void @@ -282,7 +282,7 @@ namespace __gnu_norm __throw_exception_again; } } - + template <typename _Tp, typename _Alloc> template <typename _ForwardIterator> void @@ -292,12 +292,12 @@ namespace __gnu_norm { const size_type __n = std::distance(__first, __last); this->_M_initialize_map(__n); - + _Map_pointer __cur_node; try { - for (__cur_node = this->_M_start._M_node; - __cur_node < this->_M_finish._M_node; + for (__cur_node = this->_M_start._M_node; + __cur_node < this->_M_finish._M_node; ++__cur_node) { _ForwardIterator __mid = __first; @@ -313,7 +313,7 @@ namespace __gnu_norm __throw_exception_again; } } - + // Called only if _M_finish._M_cur == _M_finish._M_last - 1. template <typename _Tp, typename _Alloc> void @@ -335,7 +335,7 @@ namespace __gnu_norm __throw_exception_again; } } - + // Called only if _M_start._M_cur == _M_start._M_first. template <typename _Tp, typename _Alloc> void @@ -357,8 +357,8 @@ namespace __gnu_norm _M_deallocate_node(*(this->_M_start._M_node - 1)); __throw_exception_again; } - } - + } + // Called only if _M_finish._M_cur == _M_finish._M_first. template <typename _Tp, typename _Alloc> void deque<_Tp,_Alloc>:: @@ -369,10 +369,10 @@ namespace __gnu_norm this->_M_finish._M_cur = this->_M_finish._M_last - 1; std::_Destroy(this->_M_finish._M_cur); } - - // Called only if _M_start._M_cur == _M_start._M_last - 1. Note that - // if the deque has at least one element (a precondition for this member - // function), and if _M_start._M_cur == _M_start._M_last, then the deque + + // Called only if _M_start._M_cur == _M_start._M_last - 1. Note that + // if the deque has at least one element (a precondition for this member + // function), and if _M_start._M_cur == _M_start._M_last, then the deque // must have at least two nodes. template <typename _Tp, typename _Alloc> void deque<_Tp,_Alloc>:: @@ -382,8 +382,8 @@ namespace __gnu_norm _M_deallocate_node(this->_M_start._M_first); this->_M_start._M_set_node(this->_M_start._M_node + 1); this->_M_start._M_cur = this->_M_start._M_first; - } - + } + template <typename _Tp, typename _Alloc> template <typename _InputIterator> void @@ -392,7 +392,7 @@ namespace __gnu_norm _InputIterator __first, _InputIterator __last, input_iterator_tag) { std::copy(__first, __last, std::inserter(*this, __pos)); } - + template <typename _Tp, typename _Alloc> template <typename _ForwardIterator> void @@ -434,7 +434,7 @@ namespace __gnu_norm else _M_insert_aux(__pos, __first, __last, __n); } - + template <typename _Tp, typename _Alloc> typename deque<_Tp, _Alloc>::iterator deque<_Tp,_Alloc>:: @@ -467,7 +467,7 @@ namespace __gnu_norm *__pos = __x_copy; return __pos; } - + template <typename _Tp, typename _Alloc> void deque<_Tp,_Alloc>:: @@ -495,14 +495,14 @@ namespace __gnu_norm else { std::__uninitialized_copy_fill(this->_M_start, __pos, - __new_start, + __new_start, this->_M_start, __x_copy); this->_M_start = __new_start; std::fill(__old_start, __pos, __x_copy); } } catch(...) - { + { _M_destroy_nodes(__new_start._M_node, this->_M_start._M_node); __throw_exception_again; } @@ -511,7 +511,7 @@ namespace __gnu_norm { iterator __new_finish = _M_reserve_elements_at_back(__n); iterator __old_finish = this->_M_finish; - const difference_type __elems_after = + const difference_type __elems_after = difference_type(__length) - __elems_before; __pos = this->_M_finish - __elems_after; try @@ -536,14 +536,14 @@ namespace __gnu_norm } } catch(...) - { + { _M_destroy_nodes(this->_M_finish._M_node + 1, __new_finish._M_node + 1); __throw_exception_again; } } } - + template <typename _Tp, typename _Alloc> template <typename _ForwardIterator> void @@ -563,7 +563,7 @@ namespace __gnu_norm { if (__elemsbefore >= difference_type(__n)) { - iterator __start_n = this->_M_start + difference_type(__n); + iterator __start_n = this->_M_start + difference_type(__n); std::uninitialized_copy(this->_M_start, __start_n, __new_start); this->_M_start = __new_start; @@ -590,7 +590,7 @@ namespace __gnu_norm { iterator __new_finish = _M_reserve_elements_at_back(__n); iterator __old_finish = this->_M_finish; - const difference_type __elemsafter = + const difference_type __elemsafter = difference_type(__length) - __elemsbefore; __pos = this->_M_finish - __elemsafter; try @@ -624,7 +624,7 @@ namespace __gnu_norm } } } - + template <typename _Tp, typename _Alloc> void deque<_Tp,_Alloc>:: @@ -642,11 +642,11 @@ namespace __gnu_norm catch(...) { for (size_type __j = 1; __j < __i; ++__j) - _M_deallocate_node(*(this->_M_start._M_node - __j)); + _M_deallocate_node(*(this->_M_start._M_node - __j)); __throw_exception_again; } } - + template <typename _Tp, typename _Alloc> void deque<_Tp,_Alloc>:: @@ -664,11 +664,11 @@ namespace __gnu_norm catch(...) { for (size_type __j = 1; __j < __i; ++__j) - _M_deallocate_node(*(this->_M_finish._M_node + __j)); + _M_deallocate_node(*(this->_M_finish._M_node + __j)); __throw_exception_again; } } - + template <typename _Tp, typename _Alloc> void deque<_Tp,_Alloc>:: @@ -677,12 +677,12 @@ namespace __gnu_norm size_type __old_num_nodes = this->_M_finish._M_node - this->_M_start._M_node + 1; size_type __new_num_nodes = __old_num_nodes + __nodes_to_add; - + _Map_pointer __new_nstart; if (this->_M_map_size > 2 * __new_num_nodes) { __new_nstart = this->_M_map + (this->_M_map_size - - __new_num_nodes) / 2 + - __new_num_nodes) / 2 + (__add_at_front ? __nodes_to_add : 0); if (__new_nstart < this->_M_start._M_node) std::copy(this->_M_start._M_node, @@ -690,7 +690,7 @@ namespace __gnu_norm __new_nstart); else std::copy_backward(this->_M_start._M_node, - this->_M_finish._M_node + 1, + this->_M_finish._M_node + 1, __new_nstart + __old_num_nodes); } else @@ -698,7 +698,7 @@ namespace __gnu_norm size_type __new_map_size = this->_M_map_size + std::max(this->_M_map_size, __nodes_to_add) + 2; - + _Map_pointer __new_map = this->_M_allocate_map(__new_map_size); __new_nstart = __new_map + (__new_map_size - __new_num_nodes) / 2 + (__add_at_front ? __nodes_to_add : 0); @@ -706,11 +706,11 @@ namespace __gnu_norm this->_M_finish._M_node + 1, __new_nstart); _M_deallocate_map(this->_M_map, this->_M_map_size); - + this->_M_map = __new_map; this->_M_map_size = __new_map_size; } - + this->_M_start._M_set_node(__new_nstart); this->_M_finish._M_set_node(__new_nstart + __old_num_nodes - 1); } diff --git a/libstdc++-v3/include/bits/fstream.tcc b/libstdc++-v3/include/bits/fstream.tcc index f28160cec94..9022b582594 100644 --- a/libstdc++-v3/include/bits/fstream.tcc +++ b/libstdc++-v3/include/bits/fstream.tcc @@ -73,20 +73,20 @@ namespace std template<typename _CharT, typename _Traits> basic_filebuf<_CharT, _Traits>:: - basic_filebuf() : __streambuf_type(), _M_file(&_M_lock), + basic_filebuf() : __streambuf_type(), _M_file(&_M_lock), _M_mode(ios_base::openmode(0)), _M_state_beg(), _M_state_cur(), _M_state_last(), _M_buf(NULL), _M_buf_size(BUFSIZ), _M_buf_allocated(false), _M_reading(false), _M_writing(false), _M_pback_cur_save(0), _M_pback_end_save(0), _M_pback_init(false), _M_codecvt(0), _M_ext_buf(0), _M_ext_buf_size(0), _M_ext_next(0), _M_ext_end(0) - { + { if (has_facet<__codecvt_type>(this->_M_buf_locale)) _M_codecvt = &use_facet<__codecvt_type>(this->_M_buf_locale); } template<typename _CharT, typename _Traits> - typename basic_filebuf<_CharT, _Traits>::__filebuf_type* + typename basic_filebuf<_CharT, _Traits>::__filebuf_type* basic_filebuf<_CharT, _Traits>:: open(const char* __s, ios_base::openmode __mode) { @@ -108,8 +108,8 @@ namespace std _M_state_last = _M_state_cur = _M_state_beg; // 27.8.1.3,4 - if ((__mode & ios_base::ate) - && this->seekoff(0, ios_base::end, __mode) + if ((__mode & ios_base::ate) + && this->seekoff(0, ios_base::end, __mode) == pos_type(off_type(-1))) this->close(); else @@ -120,7 +120,7 @@ namespace std } template<typename _CharT, typename _Traits> - typename basic_filebuf<_CharT, _Traits>::__filebuf_type* + typename basic_filebuf<_CharT, _Traits>::__filebuf_type* basic_filebuf<_CharT, _Traits>:: close() throw() { @@ -135,7 +135,7 @@ namespace std } catch(...) { __testfail = true; } - + // NB: Do this here so that re-opened filebufs will be cool... this->_M_mode = ios_base::openmode(0); this->_M_pback_init = false; @@ -144,7 +144,7 @@ namespace std _M_writing = false; _M_set_buffer(-1); _M_state_last = _M_state_cur = _M_state_beg; - + if (!_M_file.close()) __testfail = true; @@ -155,7 +155,7 @@ namespace std } template<typename _CharT, typename _Traits> - streamsize + streamsize basic_filebuf<_CharT, _Traits>:: showmanyc() { @@ -173,7 +173,7 @@ namespace std } template<typename _CharT, typename _Traits> - typename basic_filebuf<_CharT, _Traits>::int_type + typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>:: underflow() { @@ -192,15 +192,15 @@ namespace std // Get and convert input sequence. const size_t __buflen = this->_M_buf_size > 1 ? this->_M_buf_size - 1 : 1; - + // Will be set to true if ::read() returns 0 indicating EOF. bool __got_eof = false; // Number of internal characters produced. streamsize __ilen = 0; - codecvt_base::result __r = codecvt_base::ok; + codecvt_base::result __r = codecvt_base::ok; if (__check_facet(_M_codecvt).always_noconv()) { - __ilen = _M_file.xsgetn(reinterpret_cast<char*>(this->eback()), + __ilen = _M_file.xsgetn(reinterpret_cast<char*>(this->eback()), __buflen); if (__ilen == 0) __got_eof = true; @@ -226,7 +226,7 @@ namespace std // chars already present. if (_M_reading && this->egptr() == this->eback() && __remainder) __rlen = 0; - + // Allocate buffer if necessary and move unconverted // bytes to front. if (_M_ext_buf_size < __blen) @@ -269,7 +269,7 @@ namespace std char_type* __iend; __r = _M_codecvt->in(_M_state_cur, _M_ext_next, - _M_ext_end, _M_ext_next, this->eback(), + _M_ext_end, _M_ext_next, this->eback(), this->eback() + __buflen, __iend); if (__r == codecvt_base::noconv) { @@ -302,7 +302,7 @@ namespace std else if (__got_eof) { // If the actual end of file is reached, set 'uncommitted' - // mode, thus allowing an immediate write without an + // mode, thus allowing an immediate write without an // intervening seek. _M_set_buffer(-1); _M_reading = false; @@ -317,13 +317,13 @@ namespace std "invalid byte sequence in file")); else __throw_ios_failure(__N("basic_filebuf::underflow " - "error reading the file")); + "error reading the file")); } return __ret; } template<typename _CharT, typename _Traits> - typename basic_filebuf<_CharT, _Traits>::int_type + typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>:: pbackfail(int_type __i) { @@ -333,7 +333,7 @@ namespace std { // Remember whether the pback buffer is active, otherwise below // we may try to store in it a second char (libstdc++/9761). - const bool __testpb = this->_M_pback_init; + const bool __testpb = this->_M_pback_init; const bool __testeof = traits_type::eq_int_type(__i, __ret); int_type __tmp; if (this->eback() < this->gptr()) @@ -367,7 +367,7 @@ namespace std { _M_create_pback(); _M_reading = true; - *this->gptr() = traits_type::to_char_type(__i); + *this->gptr() = traits_type::to_char_type(__i); __ret = __i; } } @@ -375,7 +375,7 @@ namespace std } template<typename _CharT, typename _Traits> - typename basic_filebuf<_CharT, _Traits>::int_type + typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>:: overflow(int_type __c) { @@ -392,7 +392,7 @@ namespace std *this->pptr() = traits_type::to_char_type(__c); this->pbump(1); } - + // Convert pending sequence to external representation, // and output. if (_M_convert_to_external(this->pbase(), @@ -422,7 +422,7 @@ namespace std // Unbuffered. char_type __conv = traits_type::to_char_type(__c); if (__testeof || _M_convert_to_external(&__conv, 1)) - { + { _M_writing = true; __ret = traits_type::not_eof(__c); } @@ -430,7 +430,7 @@ namespace std } return __ret; } - + template<typename _CharT, typename _Traits> bool basic_filebuf<_CharT, _Traits>:: @@ -456,7 +456,7 @@ namespace std codecvt_base::result __r; __r = _M_codecvt->out(_M_state_cur, __ibuf, __ibuf + __ilen, __iend, __buf, __buf + __blen, __bend); - + if (__r == codecvt_base::ok || __r == codecvt_base::partial) __blen = __bend - __buf; else if (__r == codecvt_base::noconv) @@ -470,20 +470,20 @@ namespace std // Result == error. __blen = 0; } - + if (__blen) { __elen += _M_file.xsputn(__buf, __blen); __plen += __blen; } - + // Try once more for partial conversions. if (__r == codecvt_base::partial) { const char_type* __iresume = __iend; streamsize __rlen = this->pptr() - __iend; __r = _M_codecvt->out(_M_state_cur, __iresume, - __iresume + __rlen, __iend, __buf, + __iresume + __rlen, __iend, __buf, __buf + __blen, __bend); if (__r != codecvt_base::error) { @@ -500,7 +500,7 @@ namespace std streamsize basic_filebuf<_CharT, _Traits>:: xsputn(const _CharT* __s, streamsize __n) - { + { // Optimization in the always_noconv() case, to be generalized in the // future: when __n is sufficiently large we write directly instead of // using the buffer. @@ -523,7 +523,7 @@ namespace std const streamsize __buffill = this->pptr() - this->pbase(); const char* __buf = reinterpret_cast<const char*>(this->pbase()); __ret = _M_file.xsputn_2(__buf, __buffill, - reinterpret_cast<const char*>(__s), + reinterpret_cast<const char*>(__s), __n); if (__ret == __buffill + __n) { @@ -539,12 +539,12 @@ namespace std __ret = __streambuf_type::xsputn(__s, __n); } else - __ret = __streambuf_type::xsputn(__s, __n); + __ret = __streambuf_type::xsputn(__s, __n); return __ret; } template<typename _CharT, typename _Traits> - typename basic_filebuf<_CharT, _Traits>::__streambuf_type* + typename basic_filebuf<_CharT, _Traits>::__streambuf_type* basic_filebuf<_CharT, _Traits>:: setbuf(char_type* __s, streamsize __n) { @@ -564,9 +564,9 @@ namespace std this->_M_buf = __s; this->_M_buf_size = __n; } - return this; + return this; } - + // According to 27.8.1.4 p11 - 13, seekoff should ignore the last // argument (of type openmode). @@ -581,9 +581,9 @@ namespace std if (__width < 0) __width = 0; - pos_type __ret = pos_type(off_type(-1)); + pos_type __ret = pos_type(off_type(-1)); const bool __testfail = __off != 0 && __width <= 0; - if (this->is_open() && !__testfail) + if (this->is_open() && !__testfail) { // Ditch any pback buffers to avoid confusion. _M_destroy_pback(); @@ -608,10 +608,10 @@ namespace std _M_codecvt->length(_M_state_last, _M_ext_buf, _M_ext_next, this->gptr() - this->eback()); __computed_off += _M_ext_buf + __gptr_off - _M_ext_end; - + // _M_state_last is modified by codecvt::length() so - // it now corresponds to gptr(). - __state = _M_state_last; + // it now corresponds to gptr(). + __state = _M_state_last; } } __ret = _M_seek(__computed_off, __way, __state); @@ -628,8 +628,8 @@ namespace std basic_filebuf<_CharT, _Traits>:: seekpos(pos_type __pos, ios_base::openmode) { - pos_type __ret = pos_type(off_type(-1)); - if (this->is_open()) + pos_type __ret = pos_type(off_type(-1)); + if (this->is_open()) { // Ditch any pback buffers to avoid confusion. _M_destroy_pback(); @@ -645,9 +645,9 @@ namespace std { pos_type __ret = pos_type(off_type(-1)); if (_M_terminate_output()) - { + { // Returns pos_type(off_type(-1)) in case of failure. - __ret = pos_type(_M_file.seekoff(__off, __way)); + __ret = pos_type(_M_file.seekoff(__off, __way)); _M_reading = false; _M_writing = false; _M_ext_next = _M_ext_end = _M_ext_buf; @@ -671,9 +671,9 @@ namespace std if (traits_type::eq_int_type(__tmp, traits_type::eof())) __testvalid = false; } - + // Part two: output unshift sequence. - if (_M_writing && !__check_facet(_M_codecvt).always_noconv() + if (_M_writing && !__check_facet(_M_codecvt).always_noconv() && __testvalid) { // Note: this value is arbitrary, since there is no way to @@ -694,7 +694,7 @@ namespace std else if (__r == codecvt_base::ok || __r == codecvt_base::partial) { - __ilen = __next - __buf; + __ilen = __next - __buf; if (__ilen > 0) { const streamsize __elen = _M_file.xsputn(__buf, __ilen); @@ -733,7 +733,7 @@ namespace std const int_type __tmp = this->overflow(); if (traits_type::eq_int_type(__tmp, traits_type::eof())) __ret = -1; - } + } return __ret; } @@ -745,8 +745,8 @@ namespace std bool __testvalid = true; const __codecvt_type* _M_codecvt_tmp = 0; - if (__builtin_expect(has_facet<__codecvt_type>(__loc), true)) - _M_codecvt_tmp = &use_facet<__codecvt_type>(__loc); + if (__builtin_expect(has_facet<__codecvt_type>(__loc), true)) + _M_codecvt_tmp = &use_facet<__codecvt_type>(__loc); if (this->is_open()) { @@ -768,7 +768,7 @@ namespace std else { // External position corresponding to gptr(). - _M_ext_next = _M_ext_buf + _M_ext_next = _M_ext_buf + _M_codecvt->length(_M_state_last, _M_ext_buf, _M_ext_next, this->gptr() - this->eback()); const streamsize __remainder = _M_ext_end - _M_ext_next; @@ -791,7 +791,7 @@ namespace std } // Inhibit implicit instantiations for required instantiations, - // which are defined via explicit instantiations elsewhere. + // which are defined via explicit instantiations elsewhere. // NB: This syntax is a GNU extension. #if _GLIBCXX_EXTERN_TEMPLATE extern template class basic_filebuf<char>; @@ -808,4 +808,4 @@ namespace std #endif } // namespace std -#endif +#endif diff --git a/libstdc++-v3/include/bits/functexcept.h b/libstdc++-v3/include/bits/functexcept.h index eac2c95b432..8b1d16c8e59 100644 --- a/libstdc++-v3/include/bits/functexcept.h +++ b/libstdc++-v3/include/bits/functexcept.h @@ -35,22 +35,22 @@ namespace std { - // Helper for exception objects in <except> + // Helper for exception objects in <except> void __throw_bad_exception(void); - // Helper for exception objects in <new> + // Helper for exception objects in <new> void __throw_bad_alloc(void); - // Helper for exception objects in <typeinfo> + // Helper for exception objects in <typeinfo> void __throw_bad_cast(void); void __throw_bad_typeid(void); - // Helpers for exception objects in <stdexcept> + // Helpers for exception objects in <stdexcept> void __throw_logic_error(const char* __s); diff --git a/libstdc++-v3/include/bits/gslice.h b/libstdc++-v3/include/bits/gslice.h index 43cdc16ef61..ea8a9b4d430 100644 --- a/libstdc++-v3/include/bits/gslice.h +++ b/libstdc++-v3/include/bits/gslice.h @@ -41,7 +41,7 @@ #pragma GCC system_header namespace std { - + /** * @brief Class defining multi-dimensional subset of an array. * @@ -90,7 +90,7 @@ namespace std { // XXX: See the note above. /// Assignment operator. gslice& operator=(const gslice&); - + /// Return array offset of first slice element. size_t start() const; @@ -99,7 +99,7 @@ namespace std { /// Return array of array strides for each dimension. valarray<size_t> stride() const; - + private: struct _Indexer { size_t _M_count; @@ -114,22 +114,22 @@ namespace std { }; _Indexer* _M_index; - + template<typename _Tp> friend class valarray; }; - + inline size_t gslice::start () const { return _M_index ? _M_index->_M_start : 0; } - + inline valarray<size_t> gslice::size () const { return _M_index ? _M_index->_M_size : valarray<size_t>(); } - + inline valarray<size_t> gslice::stride () const { return _M_index ? _M_index->_M_stride : valarray<size_t>(); } - + inline gslice::gslice () : _M_index(0) {} inline @@ -140,7 +140,7 @@ namespace std { inline gslice::gslice(const gslice& __g) : _M_index(__g._M_index) { if (_M_index) _M_index->_M_increment_use(); } - + inline gslice::~gslice() { if (_M_index && _M_index->_M_decrement_use() == 0) delete _M_index; } @@ -153,8 +153,8 @@ namespace std { _M_index = __g._M_index; return *this; } - - + + } // std:: diff --git a/libstdc++-v3/include/bits/gslice_array.h b/libstdc++-v3/include/bits/gslice_array.h index 60e5b37cf4b..292eaec37de 100644 --- a/libstdc++-v3/include/bits/gslice_array.h +++ b/libstdc++-v3/include/bits/gslice_array.h @@ -108,13 +108,13 @@ namespace std { void operator<<=(const _Expr<_Dom,_Tp>&) const; template<class _Dom> void operator>>=(const _Expr<_Dom,_Tp>&) const; - + private: _Array<_Tp> _M_array; const valarray<size_t>& _M_index; - + friend class valarray<_Tp>; - + gslice_array(_Array<_Tp>, const valarray<size_t>&); // this constructor needs to be implemented. @@ -141,13 +141,13 @@ namespace std { gslice_array<_Tp>::gslice_array(const gslice_array<_Tp>& __a) : _M_array(__a._M_array), _M_index(__a._M_index) {} - + template<typename _Tp> inline void gslice_array<_Tp>::operator=(const _Tp& __t) const - { + { std::__valarray_fill(_M_array, _Array<size_t>(_M_index), - _M_index.size(), __t); + _M_index.size(), __t); } template<typename _Tp> @@ -178,8 +178,8 @@ namespace std { } \ \ template<typename _Tp> \ - template<class _Dom> \ - inline void \ + template<class _Dom> \ + inline void \ gslice_array<_Tp>::operator _Op##= (const _Expr<_Dom, _Tp>& __e) const\ { \ _Array_augmented_##_Name(_M_array, _Array<size_t>(_M_index), __e,\ @@ -187,9 +187,9 @@ namespace std { } _DEFINE_VALARRAY_OPERATOR(*, __multiplies) -_DEFINE_VALARRAY_OPERATOR(/, __divides) +_DEFINE_VALARRAY_OPERATOR(/, __divides) _DEFINE_VALARRAY_OPERATOR(%, __modulus) -_DEFINE_VALARRAY_OPERATOR(+, __plus) +_DEFINE_VALARRAY_OPERATOR(+, __plus) _DEFINE_VALARRAY_OPERATOR(-, __minus) _DEFINE_VALARRAY_OPERATOR(^, __bitwise_xor) _DEFINE_VALARRAY_OPERATOR(&, __bitwise_and) diff --git a/libstdc++-v3/include/bits/indirect_array.h b/libstdc++-v3/include/bits/indirect_array.h index 7e9632e4354..7f240a94c65 100644 --- a/libstdc++-v3/include/bits/indirect_array.h +++ b/libstdc++-v3/include/bits/indirect_array.h @@ -67,7 +67,7 @@ namespace std /// Assignment operator. Assigns elements to corresponding elements /// of @a a. indirect_array& operator=(const indirect_array&); - + /// Assign slice elements to corresponding elements of @a v. void operator=(const valarray<_Tp>&) const; /// Multiply slice elements by corresponding elements of @a v. @@ -75,11 +75,11 @@ namespace std /// Divide slice elements by corresponding elements of @a v. void operator/=(const valarray<_Tp>&) const; /// Modulo slice elements by corresponding elements of @a v. - void operator%=(const valarray<_Tp>&) const; + void operator%=(const valarray<_Tp>&) const; /// Add corresponding elements of @a v to slice elements. void operator+=(const valarray<_Tp>&) const; /// Subtract corresponding elements of @a v from slice elements. - void operator-=(const valarray<_Tp>&) const; + void operator-=(const valarray<_Tp>&) const; /// Logical xor slice elements with corresponding elements of @a v. void operator^=(const valarray<_Tp>&) const; /// Logical and slice elements with corresponding elements of @a v. @@ -89,11 +89,11 @@ namespace std /// Left shift slice elements by corresponding elements of @a v. void operator<<=(const valarray<_Tp>&) const; /// Right shift slice elements by corresponding elements of @a v. - void operator>>=(const valarray<_Tp>&) const; + void operator>>=(const valarray<_Tp>&) const; /// Assign all slice elements to @a t. void operator= (const _Tp&) const; // ~indirect_array(); - + template<class _Dom> void operator=(const _Expr<_Dom, _Tp>&) const; template<class _Dom> @@ -115,7 +115,7 @@ namespace std template<class _Dom> void operator<<=(const _Expr<_Dom, _Tp>&) const; template<class _Dom> - void operator>>=(const _Expr<_Dom, _Tp>&) const; + void operator>>=(const _Expr<_Dom, _Tp>&) const; private: /// Copy constructor. Both slices refer to the same underlying array. @@ -124,23 +124,23 @@ namespace std friend class valarray<_Tp>; friend class gslice_array<_Tp>; - - const size_t _M_sz; + + const size_t _M_sz; const _Array<size_t> _M_index; - const _Array<_Tp> _M_array; - + const _Array<_Tp> _M_array; + // not implemented indirect_array(); }; template<typename _Tp> - inline + inline indirect_array<_Tp>::indirect_array(const indirect_array<_Tp>& __a) : _M_sz(__a._M_sz), _M_index(__a._M_index), _M_array(__a._M_array) {} template<typename _Tp> inline - indirect_array<_Tp>::indirect_array(_Array<_Tp> __a, size_t __s, + indirect_array<_Tp>::indirect_array(_Array<_Tp> __a, size_t __s, _Array<size_t> __i) : _M_sz(__s), _M_index(__i), _M_array(__a) {} diff --git a/libstdc++-v3/include/bits/ios_base.h b/libstdc++-v3/include/bits/ios_base.h index b937ac5c567..3c05be03844 100644 --- a/libstdc++-v3/include/bits/ios_base.h +++ b/libstdc++-v3/include/bits/ios_base.h @@ -54,93 +54,93 @@ namespace std // expressions involving them are no longer compile-time constants. enum _Ios_Fmtflags { _S_ios_fmtflags_end = 1L << 16 }; - inline _Ios_Fmtflags + inline _Ios_Fmtflags operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b) { return _Ios_Fmtflags(static_cast<int>(__a) & static_cast<int>(__b)); } - inline _Ios_Fmtflags + inline _Ios_Fmtflags operator|(_Ios_Fmtflags __a, _Ios_Fmtflags __b) { return _Ios_Fmtflags(static_cast<int>(__a) | static_cast<int>(__b)); } - inline _Ios_Fmtflags + inline _Ios_Fmtflags operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b) { return _Ios_Fmtflags(static_cast<int>(__a) ^ static_cast<int>(__b)); } - inline _Ios_Fmtflags + inline _Ios_Fmtflags operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) { return __a = __a | __b; } - inline _Ios_Fmtflags + inline _Ios_Fmtflags operator&=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) { return __a = __a & __b; } - inline _Ios_Fmtflags + inline _Ios_Fmtflags operator^=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) { return __a = __a ^ __b; } - inline _Ios_Fmtflags + inline _Ios_Fmtflags operator~(_Ios_Fmtflags __a) { return _Ios_Fmtflags(~static_cast<int>(__a)); } enum _Ios_Openmode { _S_ios_openmode_end = 1L << 16 }; - inline _Ios_Openmode + inline _Ios_Openmode operator&(_Ios_Openmode __a, _Ios_Openmode __b) { return _Ios_Openmode(static_cast<int>(__a) & static_cast<int>(__b)); } - inline _Ios_Openmode + inline _Ios_Openmode operator|(_Ios_Openmode __a, _Ios_Openmode __b) { return _Ios_Openmode(static_cast<int>(__a) | static_cast<int>(__b)); } - inline _Ios_Openmode + inline _Ios_Openmode operator^(_Ios_Openmode __a, _Ios_Openmode __b) { return _Ios_Openmode(static_cast<int>(__a) ^ static_cast<int>(__b)); } - inline _Ios_Openmode + inline _Ios_Openmode operator|=(_Ios_Openmode& __a, _Ios_Openmode __b) { return __a = __a | __b; } - inline _Ios_Openmode + inline _Ios_Openmode operator&=(_Ios_Openmode& __a, _Ios_Openmode __b) { return __a = __a & __b; } - inline _Ios_Openmode + inline _Ios_Openmode operator^=(_Ios_Openmode& __a, _Ios_Openmode __b) { return __a = __a ^ __b; } - inline _Ios_Openmode + inline _Ios_Openmode operator~(_Ios_Openmode __a) { return _Ios_Openmode(~static_cast<int>(__a)); } enum _Ios_Iostate { _S_ios_iostate_end = 1L << 16 }; - inline _Ios_Iostate + inline _Ios_Iostate operator&(_Ios_Iostate __a, _Ios_Iostate __b) { return _Ios_Iostate(static_cast<int>(__a) & static_cast<int>(__b)); } - inline _Ios_Iostate + inline _Ios_Iostate operator|(_Ios_Iostate __a, _Ios_Iostate __b) { return _Ios_Iostate(static_cast<int>(__a) | static_cast<int>(__b)); } - inline _Ios_Iostate + inline _Ios_Iostate operator^(_Ios_Iostate __a, _Ios_Iostate __b) { return _Ios_Iostate(static_cast<int>(__a) ^ static_cast<int>(__b)); } - inline _Ios_Iostate + inline _Ios_Iostate operator|=(_Ios_Iostate& __a, _Ios_Iostate __b) { return __a = __a | __b; } - inline _Ios_Iostate + inline _Ios_Iostate operator&=(_Ios_Iostate& __a, _Ios_Iostate __b) { return __a = __a & __b; } - inline _Ios_Iostate + inline _Ios_Iostate operator^=(_Ios_Iostate& __a, _Ios_Iostate __b) { return __a = __a ^ __b; } - inline _Ios_Iostate + inline _Ios_Iostate operator~(_Ios_Iostate __a) { return _Ios_Iostate(~static_cast<int>(__a)); } @@ -158,7 +158,7 @@ namespace std class ios_base { public: - + // 27.4.2.1.1 Class ios_base::failure /// These are thrown to indicate problems. Doc me. class failure : public exception @@ -166,17 +166,17 @@ namespace std public: // _GLIBCXX_RESOLVE_LIB_DEFECTS // 48. Use of non-existent exception constructor - explicit + explicit failure(const string& __str) throw(); // This declaration is not useless: // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 - virtual + virtual ~failure() throw(); virtual const char* what() const throw(); - + private: string _M_msg; }; @@ -286,18 +286,18 @@ namespace std /// Indicates a loss of integrity in an input or output sequence (such /// as an irrecoverable read error from a file). - static const iostate badbit = iostate(__ios_flags::_S_badbit); + static const iostate badbit = iostate(__ios_flags::_S_badbit); /// Indicates that an input operation reached the end of an input sequence. - static const iostate eofbit = iostate(__ios_flags::_S_eofbit); + static const iostate eofbit = iostate(__ios_flags::_S_eofbit); /// Indicates that an input operation failed to read the expected /// characters, or that an output operation failed to generate the /// desired characters. - static const iostate failbit = iostate(__ios_flags::_S_failbit); + static const iostate failbit = iostate(__ios_flags::_S_failbit); /// Indicates all is well. - static const iostate goodbit = iostate(0); + static const iostate goodbit = iostate(0); // 27.4.2.1.4 Type ios_base::openmode /** @@ -316,25 +316,25 @@ namespace std typedef _Ios_Openmode openmode; /// Seek to end before each write. - static const openmode app = openmode(__ios_flags::_S_app); + static const openmode app = openmode(__ios_flags::_S_app); /// Open and seek to end immediately after opening. - static const openmode ate = openmode(__ios_flags::_S_ate); + static const openmode ate = openmode(__ios_flags::_S_ate); /// Perform input and output in binary mode (as opposed to text mode). /// This is probably not what you think it is; see /// http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#3 and /// http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#7 for more. - static const openmode binary = openmode(__ios_flags::_S_bin); + static const openmode binary = openmode(__ios_flags::_S_bin); /// Open for input. Default for @c ifstream and fstream. - static const openmode in = openmode(__ios_flags::_S_in); + static const openmode in = openmode(__ios_flags::_S_in); /// Open for output. Default for @c ofstream and fstream. - static const openmode out = openmode(__ios_flags::_S_out); + static const openmode out = openmode(__ios_flags::_S_out); /// Open for input. Default for @c ofstream. - static const openmode trunc = openmode(__ios_flags::_S_trunc); + static const openmode trunc = openmode(__ios_flags::_S_trunc); // 27.4.2.1.5 Type ios_base::seekdir /** @@ -349,20 +349,20 @@ namespace std typedef _Ios_Seekdir seekdir; /// Request a seek relative to the beginning of the stream. - static const seekdir beg = seekdir(0); + static const seekdir beg = seekdir(0); /// Request a seek relative to the current position within the sequence. - static const seekdir cur = seekdir(SEEK_CUR); + static const seekdir cur = seekdir(SEEK_CUR); /// Request a seek relative to the current end of the sequence. - static const seekdir end = seekdir(SEEK_END); + static const seekdir end = seekdir(SEEK_END); #ifdef _GLIBCXX_DEPRECATED // Annex D.6 typedef int io_state; typedef int open_mode; typedef int seek_dir; - + typedef std::streampos streampos; typedef std::streamoff streamoff; #endif @@ -403,7 +403,7 @@ namespace std * function are allowed. If there are multiple callbacks, they are * invoked in the order they were registered. */ - void + void register_callback(event_callback __fn, int __index); protected: @@ -413,11 +413,11 @@ namespace std * ios_base data members (doc me) * @endif */ - streamsize _M_precision; - streamsize _M_width; - fmtflags _M_flags; - iostate _M_exception; - iostate _M_streambuf_state; + streamsize _M_precision; + streamsize _M_width; + fmtflags _M_flags; + iostate _M_exception; + iostate _M_streambuf_state; //@} // 27.4.2.6 Members for callbacks @@ -425,58 +425,58 @@ namespace std struct _Callback_list { // Data Members - _Callback_list* _M_next; - ios_base::event_callback _M_fn; - int _M_index; + _Callback_list* _M_next; + ios_base::event_callback _M_fn; + int _M_index; _Atomic_word _M_refcount; // 0 means one reference. - - _Callback_list(ios_base::event_callback __fn, int __index, + + _Callback_list(ios_base::event_callback __fn, int __index, _Callback_list* __cb) : _M_next(__cb), _M_fn(__fn), _M_index(__index), _M_refcount(0) { } - - void + + void _M_add_reference() { __atomic_add(&_M_refcount, 1); } // 0 => OK to delete. - int + int _M_remove_reference() { return __exchange_and_add(&_M_refcount, -1); } }; - _Callback_list* _M_callbacks; + _Callback_list* _M_callbacks; - void + void _M_call_callbacks(event __ev) throw(); - void + void _M_dispose_callbacks(void); // 27.4.2.5 Members for iword/pword storage - struct _Words - { - void* _M_pword; - long _M_iword; + struct _Words + { + void* _M_pword; + long _M_iword; _Words() : _M_pword(0), _M_iword(0) { } }; // Only for failed iword/pword calls. - _Words _M_word_zero; + _Words _M_word_zero; // Guaranteed storage. // The first 5 iword and pword slots are reserved for internal use. - static const int _S_local_word_size = 8; - _Words _M_local_word[_S_local_word_size]; + static const int _S_local_word_size = 8; + _Words _M_local_word[_S_local_word_size]; // Allocated storage. - int _M_word_size; - _Words* _M_word; - - _Words& + int _M_word_size; + _Words* _M_word; + + _Words& _M_grow_words(int __index, bool __iword); // Members for locale and locale caching. - locale _M_ios_locale; + locale _M_ios_locale; - void + void _M_init(); public: @@ -484,14 +484,14 @@ namespace std // 27.4.2.1.6 Class ios_base::Init // Used to initialize standard streams. In theory, g++ could use // -finit-priority to order this stuff correctly without going - // through these machinations. - class Init + // through these machinations. + class Init { friend class ios_base; public: Init(); ~Init(); - + private: static _Atomic_word _S_refcount; static bool _S_synced_with_stdio; @@ -502,7 +502,7 @@ namespace std * @brief Access to format flags. * @return The format control flags for both input and output. */ - inline fmtflags + inline fmtflags flags() const { return _M_flags; } /** @@ -512,12 +512,12 @@ namespace std * * This function overwrites all the format flags with @a fmtfl. */ - inline fmtflags + inline fmtflags flags(fmtflags __fmtfl) - { - fmtflags __old = _M_flags; - _M_flags = __fmtfl; - return __old; + { + fmtflags __old = _M_flags; + _M_flags = __fmtfl; + return __old; } /** @@ -528,12 +528,12 @@ namespace std * This function sets additional flags in format control. Flags that * were previously set remain set. */ - inline fmtflags + inline fmtflags setf(fmtflags __fmtfl) - { - fmtflags __old = _M_flags; - _M_flags |= __fmtfl; - return __old; + { + fmtflags __old = _M_flags; + _M_flags |= __fmtfl; + return __old; } /** @@ -545,7 +545,7 @@ namespace std * This function clears @a mask in the format flags, then sets * @a fmtfl @c & @a mask. An example mask is @c ios_base::adjustfield. */ - inline fmtflags + inline fmtflags setf(fmtflags __fmtfl, fmtflags __mask) { fmtflags __old = _M_flags; @@ -560,7 +560,7 @@ namespace std * * This function clears @a mask in the format flags. */ - inline void + inline void unsetf(fmtflags __mask) { _M_flags &= ~__mask; } /** @@ -572,7 +572,7 @@ namespace std * DR 189. * @endif */ - inline streamsize + inline streamsize precision() const { return _M_precision; } /** @@ -580,12 +580,12 @@ namespace std * @param prec The new precision value. * @return The previous value of precision(). */ - inline streamsize + inline streamsize precision(streamsize __prec) - { - streamsize __old = _M_precision; - _M_precision = __prec; - return __old; + { + streamsize __old = _M_precision; + _M_precision = __prec; + return __old; } /** @@ -594,7 +594,7 @@ namespace std * * "Minimum field width" refers to the number of characters. */ - inline streamsize + inline streamsize width() const { return _M_width; } /** @@ -602,12 +602,12 @@ namespace std * @param wide The new width value. * @return The previous value of width(). */ - inline streamsize + inline streamsize width(streamsize __wide) - { - streamsize __old = _M_width; - _M_width = __wide; - return __old; + { + streamsize __old = _M_width; + _M_width = __wide; + return __old; } // [27.4.2.4] ios_base static members @@ -621,7 +621,7 @@ namespace std * cout). User-declared streams are unaffected. See * http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#8 for more. */ - static bool + static bool sync_with_stdio(bool __sync = true); // [27.4.2.3] ios_base locale functions @@ -633,7 +633,7 @@ namespace std * Sets the new locale for this stream, and then invokes each callback * with imbue_event. */ - locale + locale imbue(const locale& __loc); /** @@ -644,7 +644,7 @@ namespace std * returns @c loc. Otherwise, it returns a copy of @c std::locale(), * the global C++ locale. */ - inline locale + inline locale getloc() const { return _M_ios_locale; } /** @@ -654,7 +654,7 @@ namespace std * Like getloc above, but returns a reference instead of * generating a copy. */ - inline const locale& + inline const locale& _M_getloc() const { return _M_ios_locale; } // [27.4.2.5] ios_base storage functions @@ -672,7 +672,7 @@ namespace std * returned on each invocation. xalloc is guaranteed to return an index * that is safe to use in the iword and pword arrays. */ - static int + static int xalloc() throw(); /** @@ -688,10 +688,10 @@ namespace std * obtain an index that is safe to use. Also note that since the array * can grow dynamically, it is not safe to hold onto the reference. */ - inline long& + inline long& iword(int __ix) { - _Words& __word = (__ix < _M_word_size) + _Words& __word = (__ix < _M_word_size) ? _M_word[__ix] : _M_grow_words(__ix, true); return __word._M_iword; } @@ -709,10 +709,10 @@ namespace std * obtain an index that is safe to use. Also note that since the array * can grow dynamically, it is not safe to hold onto the reference. */ - inline void*& + inline void*& pword(int __ix) { - _Words& __word = (__ix < _M_word_size) + _Words& __word = (__ix < _M_word_size) ? _M_word[__ix] : _M_grow_words(__ix, false); return __word._M_pword; } @@ -736,13 +736,13 @@ namespace std private: ios_base(const ios_base&); - ios_base& + ios_base& operator=(const ios_base&); }; - + // [27.4.5.1] fmtflags manipulators /// Calls base.setf(ios_base::boolalpha). - inline ios_base& + inline ios_base& boolalpha(ios_base& __base) { __base.setf(ios_base::boolalpha); @@ -750,7 +750,7 @@ namespace std } /// Calls base.unsetf(ios_base::boolalpha). - inline ios_base& + inline ios_base& noboolalpha(ios_base& __base) { __base.unsetf(ios_base::boolalpha); @@ -758,7 +758,7 @@ namespace std } /// Calls base.setf(ios_base::showbase). - inline ios_base& + inline ios_base& showbase(ios_base& __base) { __base.setf(ios_base::showbase); @@ -766,7 +766,7 @@ namespace std } /// Calls base.unsetf(ios_base::showbase). - inline ios_base& + inline ios_base& noshowbase(ios_base& __base) { __base.unsetf(ios_base::showbase); @@ -774,7 +774,7 @@ namespace std } /// Calls base.setf(ios_base::showpoint). - inline ios_base& + inline ios_base& showpoint(ios_base& __base) { __base.setf(ios_base::showpoint); @@ -782,7 +782,7 @@ namespace std } /// Calls base.unsetf(ios_base::showpoint). - inline ios_base& + inline ios_base& noshowpoint(ios_base& __base) { __base.unsetf(ios_base::showpoint); @@ -790,7 +790,7 @@ namespace std } /// Calls base.setf(ios_base::showpos). - inline ios_base& + inline ios_base& showpos(ios_base& __base) { __base.setf(ios_base::showpos); @@ -798,7 +798,7 @@ namespace std } /// Calls base.unsetf(ios_base::showpos). - inline ios_base& + inline ios_base& noshowpos(ios_base& __base) { __base.unsetf(ios_base::showpos); @@ -806,15 +806,15 @@ namespace std } /// Calls base.setf(ios_base::skipws). - inline ios_base& + inline ios_base& skipws(ios_base& __base) { __base.setf(ios_base::skipws); return __base; } - + /// Calls base.unsetf(ios_base::skipws). - inline ios_base& + inline ios_base& noskipws(ios_base& __base) { __base.unsetf(ios_base::skipws); @@ -822,7 +822,7 @@ namespace std } /// Calls base.setf(ios_base::uppercase). - inline ios_base& + inline ios_base& uppercase(ios_base& __base) { __base.setf(ios_base::uppercase); @@ -830,7 +830,7 @@ namespace std } /// Calls base.unsetf(ios_base::uppercase). - inline ios_base& + inline ios_base& nouppercase(ios_base& __base) { __base.unsetf(ios_base::uppercase); @@ -838,57 +838,57 @@ namespace std } /// Calls base.setf(ios_base::unitbuf). - inline ios_base& + inline ios_base& unitbuf(ios_base& __base) { - __base.setf(ios_base::unitbuf); + __base.setf(ios_base::unitbuf); return __base; } /// Calls base.unsetf(ios_base::unitbuf). - inline ios_base& + inline ios_base& nounitbuf(ios_base& __base) { __base.unsetf(ios_base::unitbuf); - return __base; + return __base; } // [27.4.5.2] adjustfield anipulators /// Calls base.setf(ios_base::internal, ios_base::adjustfield). - inline ios_base& + inline ios_base& internal(ios_base& __base) { __base.setf(ios_base::internal, ios_base::adjustfield); - return __base; + return __base; } /// Calls base.setf(ios_base::left, ios_base::adjustfield). - inline ios_base& + inline ios_base& left(ios_base& __base) { __base.setf(ios_base::left, ios_base::adjustfield); return __base; } - + /// Calls base.setf(ios_base::right, ios_base::adjustfield). - inline ios_base& + inline ios_base& right(ios_base& __base) { __base.setf(ios_base::right, ios_base::adjustfield); return __base; } - + // [27.4.5.3] basefield anipulators /// Calls base.setf(ios_base::dec, ios_base::basefield). - inline ios_base& + inline ios_base& dec(ios_base& __base) { __base.setf(ios_base::dec, ios_base::basefield); return __base; } - + /// Calls base.setf(ios_base::hex, ios_base::basefield). - inline ios_base& + inline ios_base& hex(ios_base& __base) { __base.setf(ios_base::hex, ios_base::basefield); @@ -896,16 +896,16 @@ namespace std } /// Calls base.setf(ios_base::oct, ios_base::basefield). - inline ios_base& + inline ios_base& oct(ios_base& __base) { __base.setf(ios_base::oct, ios_base::basefield); return __base; } - + // [27.4.5.4] floatfield anipulators /// Calls base.setf(ios_base::fixed, ios_base::floatfield). - inline ios_base& + inline ios_base& fixed(ios_base& __base) { __base.setf(ios_base::fixed, ios_base::floatfield); @@ -913,7 +913,7 @@ namespace std } /// Calls base.setf(ios_base::scientific, ios_base::floatfield). - inline ios_base& + inline ios_base& scientific(ios_base& __base) { __base.setf(ios_base::scientific, ios_base::floatfield); diff --git a/libstdc++-v3/include/bits/istream.tcc b/libstdc++-v3/include/bits/istream.tcc index abe795031df..3edb8cdeea1 100644 --- a/libstdc++-v3/include/bits/istream.tcc +++ b/libstdc++-v3/include/bits/istream.tcc @@ -40,26 +40,26 @@ #include <locale> #include <ostream> // For flush() -namespace std +namespace std { template<typename _CharT, typename _Traits> basic_istream<_CharT, _Traits>::sentry:: sentry(basic_istream<_CharT, _Traits>& __in, bool __noskipws) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - if (__in.good()) + if (__in.good()) { if (__in.tie()) __in.tie()->flush(); if (!__noskipws && (__in.flags() & ios_base::skipws)) - { + { const __int_type __eof = traits_type::eof(); __streambuf_type* __sb = __in.rdbuf(); __int_type __c = __sb->sgetc(); const __ctype_type& __ct = __check_facet(__in._M_ctype); while (!traits_type::eq_int_type(__c, __eof) - && __ct.is(ctype_base::space, + && __ct.is(ctype_base::space, traits_type::to_char_type(__c))) __c = __sb->snextc(); @@ -82,39 +82,39 @@ namespace std } template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& + basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: operator>>(__istream_type& (*__pf)(__istream_type&)) { return __pf(*this); } template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& + basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: operator>>(__ios_type& (*__pf)(__ios_type&)) { __pf(*this); return *this; } - + template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& + basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: operator>>(ios_base& (*__pf)(ios_base&)) { __pf(*this); return *this; } - + template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& + basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: operator>>(bool& __n) { sentry __cerb(*this, false); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { const __num_get_type& __ng = __check_facet(this->_M_num_get); __ng.get(*this, 0, *this, __err, __n); @@ -128,15 +128,15 @@ namespace std } template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& + basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: operator>>(short& __n) { sentry __cerb(*this, false); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { long __l; const __num_get_type& __ng = __check_facet(this->_M_num_get); @@ -144,7 +144,7 @@ namespace std // _GLIBCXX_RESOLVE_LIB_DEFECTS // 118. basic_istream uses nonexistent num_get member functions. if (!(__err & ios_base::failbit) - && (numeric_limits<short>::min() <= __l + && (numeric_limits<short>::min() <= __l && __l <= numeric_limits<short>::max())) __n = __l; else @@ -159,15 +159,15 @@ namespace std } template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& + basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: operator>>(unsigned short& __n) { sentry __cerb(*this, false); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { const __num_get_type& __ng = __check_facet(this->_M_num_get); __ng.get(*this, 0, *this, __err, __n); @@ -181,15 +181,15 @@ namespace std } template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& + basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: operator>>(int& __n) { sentry __cerb(*this, false); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { long __l; const __num_get_type& __ng = __check_facet(this->_M_num_get); @@ -197,7 +197,7 @@ namespace std // _GLIBCXX_RESOLVE_LIB_DEFECTS // 118. basic_istream uses nonexistent num_get member functions. if (!(__err & ios_base::failbit) - && (numeric_limits<int>::min() <= __l + && (numeric_limits<int>::min() <= __l && __l <= numeric_limits<int>::max())) __n = __l; else @@ -212,15 +212,15 @@ namespace std } template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& + basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: operator>>(unsigned int& __n) { sentry __cerb(*this, false); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { const __num_get_type& __ng = __check_facet(this->_M_num_get); __ng.get(*this, 0, *this, __err, __n); @@ -234,15 +234,15 @@ namespace std } template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& + basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: operator>>(long& __n) { sentry __cerb(*this, false); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { const __num_get_type& __ng = __check_facet(this->_M_num_get); __ng.get(*this, 0, *this, __err, __n); @@ -256,15 +256,15 @@ namespace std } template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& + basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: operator>>(unsigned long& __n) { sentry __cerb(*this, false); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { const __num_get_type& __ng = __check_facet(this->_M_num_get); __ng.get(*this, 0, *this, __err, __n); @@ -279,15 +279,15 @@ namespace std #ifdef _GLIBCXX_USE_LONG_LONG template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& + basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: operator>>(long long& __n) { sentry __cerb(*this, false); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { const __num_get_type& __ng = __check_facet(this->_M_num_get); __ng.get(*this, 0, *this, __err, __n); @@ -301,15 +301,15 @@ namespace std } template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& + basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: operator>>(unsigned long long& __n) { sentry __cerb(*this, false); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { const __num_get_type& __ng = __check_facet(this->_M_num_get); __ng.get(*this, 0, *this, __err, __n); @@ -324,15 +324,15 @@ namespace std #endif template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& + basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: operator>>(float& __n) { sentry __cerb(*this, false); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { const __num_get_type& __ng = __check_facet(this->_M_num_get); __ng.get(*this, 0, *this, __err, __n); @@ -346,15 +346,15 @@ namespace std } template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& + basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: operator>>(double& __n) { sentry __cerb(*this, false); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { const __num_get_type& __ng = __check_facet(this->_M_num_get); __ng.get(*this, 0, *this, __err, __n); @@ -368,15 +368,15 @@ namespace std } template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& + basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: operator>>(long double& __n) { sentry __cerb(*this, false); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { const __num_get_type& __ng = __check_facet(this->_M_num_get); __ng.get(*this, 0, *this, __err, __n); @@ -390,15 +390,15 @@ namespace std } template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& + basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: operator>>(void*& __n) { sentry __cerb(*this, false); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { const __num_get_type& __ng = __check_facet(this->_M_num_get); __ng.get(*this, 0, *this, __err, __n); @@ -412,7 +412,7 @@ namespace std } template<typename _CharT, typename _Traits> - basic_istream<_CharT, _Traits>& + basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: operator>>(__streambuf_type* __sbout) { @@ -445,9 +445,9 @@ namespace std _M_gcount = 0; ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); sentry __cerb(*this, true); - if (__cerb) + if (__cerb) { - try + try { __c = this->rdbuf()->sbumpc(); // 27.6.1.1 paragraph 3 @@ -474,9 +474,9 @@ namespace std _M_gcount = 0; ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); sentry __cerb(*this, true); - if (__cerb) + if (__cerb) { - try + try { int_type __cb = this->rdbuf()->sbumpc(); // 27.6.1.1 paragraph 3 @@ -506,16 +506,16 @@ namespace std _M_gcount = 0; ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); sentry __cerb(*this, true); - if (__cerb) + if (__cerb) { - try + try { const int_type __idelim = traits_type::to_int_type(__delim); const int_type __eof = traits_type::eof(); __streambuf_type* __sb = this->rdbuf(); - int_type __c = __sb->sgetc(); - - while (_M_gcount + 1 < __n + int_type __c = __sb->sgetc(); + + while (_M_gcount + 1 < __n && !traits_type::eq_int_type(__c, __eof) && !traits_type::eq_int_type(__c, __idelim)) { @@ -545,18 +545,18 @@ namespace std _M_gcount = 0; ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); sentry __cerb(*this, true); - if (__cerb) + if (__cerb) { - try + try { const int_type __idelim = traits_type::to_int_type(__delim); - const int_type __eof = traits_type::eof(); + const int_type __eof = traits_type::eof(); __streambuf_type* __this_sb = this->rdbuf(); int_type __c = __this_sb->sgetc(); char_type __c2 = traits_type::to_char_type(__c); - - while (!traits_type::eq_int_type(__c, __eof) - && !traits_type::eq_int_type(__c, __idelim) + + while (!traits_type::eq_int_type(__c, __eof) + && !traits_type::eq_int_type(__c, __idelim) && !traits_type::eq_int_type(__sb.sputc(__c2), __eof)) { ++_M_gcount; @@ -584,16 +584,16 @@ namespace std _M_gcount = 0; ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); sentry __cerb(*this, true); - if (__cerb) + if (__cerb) { - try + try { const int_type __idelim = traits_type::to_int_type(__delim); const int_type __eof = traits_type::eof(); __streambuf_type* __sb = this->rdbuf(); int_type __c = __sb->sgetc(); - - while (_M_gcount + 1 < __n + + while (_M_gcount + 1 < __n && !traits_type::eq_int_type(__c, __eof) && !traits_type::eq_int_type(__c, __idelim)) { @@ -624,7 +624,7 @@ namespace std this->setstate(__err); return *this; } - + template<typename _CharT, typename _Traits> basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: @@ -632,17 +632,17 @@ namespace std { _M_gcount = 0; sentry __cerb(*this, true); - if (__cerb && __n > 0) + if (__cerb && __n > 0) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { const int_type __eof = traits_type::eof(); __streambuf_type* __sb = this->rdbuf(); int_type __c; - + __n = std::min(__n, numeric_limits<streamsize>::max()); - while (_M_gcount < __n + while (_M_gcount < __n && !traits_type::eq_int_type(__c = __sb->sbumpc(), __eof)) { ++_M_gcount; @@ -659,7 +659,7 @@ namespace std } return *this; } - + template<typename _CharT, typename _Traits> typename basic_istream<_CharT, _Traits>::int_type basic_istream<_CharT, _Traits>:: @@ -671,7 +671,7 @@ namespace std if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { __c = this->rdbuf()->sgetc(); if (traits_type::eq_int_type(__c, traits_type::eof())) @@ -681,7 +681,7 @@ namespace std { this->_M_setstate(ios_base::badbit); } if (__err) this->setstate(__err); - } + } return __c; } @@ -692,15 +692,15 @@ namespace std { _M_gcount = 0; sentry __cerb(*this, true); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { _M_gcount = this->rdbuf()->sgetn(__s, __n); if (_M_gcount != __n) __err |= (ios_base::eofbit | ios_base::failbit); - } + } catch(...) { this->_M_setstate(ios_base::badbit); } if (__err) @@ -708,18 +708,18 @@ namespace std } return *this; } - + template<typename _CharT, typename _Traits> - streamsize + streamsize basic_istream<_CharT, _Traits>:: readsome(char_type* __s, streamsize __n) { _M_gcount = 0; sentry __cerb(*this, true); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { // Cannot compare int_type with streamsize generically. streamsize __num = this->rdbuf()->in_avail(); @@ -739,7 +739,7 @@ namespace std } return _M_gcount; } - + template<typename _CharT, typename _Traits> basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: @@ -749,14 +749,14 @@ namespace std // 60. What is a formatted input function? _M_gcount = 0; sentry __cerb(*this, true); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { const int_type __eof = traits_type::eof(); __streambuf_type* __sb = this->rdbuf(); - if (!__sb + if (!__sb || traits_type::eq_int_type(__sb->sputbackc(__c), __eof)) __err |= ios_base::badbit; } @@ -767,7 +767,7 @@ namespace std } return *this; } - + template<typename _CharT, typename _Traits> basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>:: @@ -777,14 +777,14 @@ namespace std // 60. What is a formatted input function? _M_gcount = 0; sentry __cerb(*this, true); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { const int_type __eof = traits_type::eof(); __streambuf_type* __sb = this->rdbuf(); - if (!__sb + if (!__sb || traits_type::eq_int_type(__sb->sungetc(), __eof)) __err |= ios_base::badbit; } @@ -795,7 +795,7 @@ namespace std } return *this; } - + template<typename _CharT, typename _Traits> int basic_istream<_CharT, _Traits>:: @@ -805,17 +805,17 @@ namespace std // DR60. Do not change _M_gcount. int __ret = -1; sentry __cerb(*this, true); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { __streambuf_type* __sb = this->rdbuf(); if (__sb) { if (__sb->pubsync() == -1) __err |= ios_base::badbit; - else + else __ret = 0; } } @@ -826,7 +826,7 @@ namespace std } return __ret; } - + template<typename _CharT, typename _Traits> typename basic_istream<_CharT, _Traits>::pos_type basic_istream<_CharT, _Traits>:: @@ -885,9 +885,9 @@ namespace std if (!this->fail()) { // 136. seekp, seekg setting wrong streams? - pos_type __p = this->rdbuf()->pubseekoff(__off, __dir, + pos_type __p = this->rdbuf()->pubseekoff(__off, __dir, ios_base::in); - + // 129. Need error indication from seekp() and seekg() if (__p == pos_type(off_type(-1))) __err |= ios_base::failbit; @@ -905,12 +905,12 @@ namespace std basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) { - typedef basic_istream<_CharT, _Traits> __istream_type; + typedef basic_istream<_CharT, _Traits> __istream_type; typename __istream_type::sentry __cerb(__in, false); if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { typename __istream_type::int_type __cb = __in.rdbuf()->sbumpc(); if (!_Traits::eq_int_type(__cb, _Traits::eof())) @@ -930,33 +930,33 @@ namespace std basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) { - typedef basic_istream<_CharT, _Traits> __istream_type; + typedef basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::__streambuf_type __streambuf_type; - typedef typename _Traits::int_type int_type; - typedef _CharT char_type; - typedef ctype<_CharT> __ctype_type; + typedef typename _Traits::int_type int_type; + typedef _CharT char_type; + typedef ctype<_CharT> __ctype_type; streamsize __extracted = 0; ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); typename __istream_type::sentry __cerb(__in, false); if (__cerb) { - try + try { // Figure out how many characters to extract. streamsize __num = __in.width(); if (__num <= 0) __num = numeric_limits<streamsize>::max(); - + const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc()); const int_type __eof = _Traits::eof(); __streambuf_type* __sb = __in.rdbuf(); int_type __c = __sb->sgetc(); - - while (__extracted < __num - 1 + + while (__extracted < __num - 1 && !_Traits::eq_int_type(__c, __eof) - && !__ct.is(ctype_base::space, + && !__ct.is(ctype_base::space, _Traits::to_char_type(__c))) { *__s++ = _Traits::to_char_type(__c); @@ -983,20 +983,20 @@ namespace std // 27.6.1.4 Standard basic_istream manipulators template<typename _CharT, typename _Traits> - basic_istream<_CharT,_Traits>& + basic_istream<_CharT,_Traits>& ws(basic_istream<_CharT,_Traits>& __in) { - typedef basic_istream<_CharT, _Traits> __istream_type; + typedef basic_istream<_CharT, _Traits> __istream_type; typedef typename __istream_type::__streambuf_type __streambuf_type; - typedef typename __istream_type::__ctype_type __ctype_type; - typedef typename __istream_type::int_type __int_type; + typedef typename __istream_type::__ctype_type __ctype_type; + typedef typename __istream_type::int_type __int_type; const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc()); - const __int_type __eof = _Traits::eof(); + const __int_type __eof = _Traits::eof(); __streambuf_type* __sb = __in.rdbuf(); __int_type __c = __sb->sgetc(); - while (!_Traits::eq_int_type(__c, __eof) + while (!_Traits::eq_int_type(__c, __eof) && __ct.is(ctype_base::space, _Traits::to_char_type(__c))) __c = __sb->snextc(); @@ -1011,17 +1011,17 @@ namespace std operator>>(basic_istream<_CharT, _Traits>& __in, basic_string<_CharT, _Traits, _Alloc>& __str) { - typedef basic_istream<_CharT, _Traits> __istream_type; - typedef typename __istream_type::int_type __int_type; + typedef basic_istream<_CharT, _Traits> __istream_type; + typedef typename __istream_type::int_type __int_type; typedef typename __istream_type::__streambuf_type __streambuf_type; - typedef typename __istream_type::__ctype_type __ctype_type; - typedef basic_string<_CharT, _Traits, _Alloc> __string_type; + typedef typename __istream_type::__ctype_type __ctype_type; + typedef basic_string<_CharT, _Traits, _Alloc> __string_type; typedef typename __string_type::size_type __size_type; __size_type __extracted = 0; ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); typename __istream_type::sentry __cerb(__in, false); - if (__cerb) + if (__cerb) { try { @@ -1029,13 +1029,13 @@ namespace std streamsize __w = __in.width(); __size_type __n; __n = __w > 0 ? static_cast<__size_type>(__w) : __str.max_size(); - + const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc()); const __int_type __eof = _Traits::eof(); __streambuf_type* __sb = __in.rdbuf(); __int_type __c = __sb->sgetc(); - - while (__extracted < __n + + while (__extracted < __n && !_Traits::eq_int_type(__c, __eof) && !__ct.is(ctype_base::space, _Traits::to_char_type(__c))) { @@ -1068,11 +1068,11 @@ namespace std getline(basic_istream<_CharT, _Traits>& __in, basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim) { - typedef basic_istream<_CharT, _Traits> __istream_type; - typedef typename __istream_type::int_type __int_type; + typedef basic_istream<_CharT, _Traits> __istream_type; + typedef typename __istream_type::int_type __int_type; typedef typename __istream_type::__streambuf_type __streambuf_type; - typedef typename __istream_type::__ctype_type __ctype_type; - typedef basic_string<_CharT, _Traits, _Alloc> __string_type; + typedef typename __istream_type::__ctype_type __ctype_type; + typedef basic_string<_CharT, _Traits, _Alloc> __string_type; typedef typename __string_type::size_type __size_type; __size_type __extracted = 0; @@ -1080,7 +1080,7 @@ namespace std bool __testdelim = false; ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); typename __istream_type::sentry __cerb(__in, true); - if (__cerb) + if (__cerb) { try { @@ -1090,7 +1090,7 @@ namespace std __int_type __c = __sb->sbumpc(); const __int_type __eof = _Traits::eof(); __testdelim = _Traits::eq_int_type(__c, __idelim); - + while (!_Traits::eq_int_type(__c, __eof) && !__testdelim && __extracted < __n) { @@ -1119,12 +1119,12 @@ namespace std template<class _CharT, class _Traits, class _Alloc> inline basic_istream<_CharT,_Traits>& - getline(basic_istream<_CharT, _Traits>& __in, + getline(basic_istream<_CharT, _Traits>& __in, basic_string<_CharT,_Traits,_Alloc>& __str) { return getline(__in, __str, __in.widen('\n')); } // Inhibit implicit instantiations for required instantiations, - // which are defined via explicit instantiations elsewhere. + // which are defined via explicit instantiations elsewhere. // NB: This syntax is a GNU extension. #if _GLIBCXX_EXTERN_TEMPLATE extern template class basic_istream<char>; diff --git a/libstdc++-v3/include/bits/list.tcc b/libstdc++-v3/include/bits/list.tcc index 2c3e670d3b0..c5e20f8e5d7 100644 --- a/libstdc++-v3/include/bits/list.tcc +++ b/libstdc++-v3/include/bits/list.tcc @@ -78,7 +78,7 @@ namespace __gnu_norm _M_put_node(__tmp); } } - + template<typename _Tp, typename _Alloc> typename list<_Tp,_Alloc>::iterator list<_Tp,_Alloc>:: @@ -88,7 +88,7 @@ namespace __gnu_norm __tmp->hook(__position._M_node); return __tmp; } - + template<typename _Tp, typename _Alloc> typename list<_Tp,_Alloc>::iterator list<_Tp,_Alloc>:: @@ -98,7 +98,7 @@ namespace __gnu_norm _M_erase(__position); return __ret; } - + template<typename _Tp, typename _Alloc> void list<_Tp,_Alloc>:: @@ -113,7 +113,7 @@ namespace __gnu_norm else // __i == end() insert(end(), __new_size - __len, __x); } - + template<typename _Tp, typename _Alloc> list<_Tp,_Alloc>& list<_Tp,_Alloc>:: @@ -134,7 +134,7 @@ namespace __gnu_norm } return *this; } - + template<typename _Tp, typename _Alloc> void list<_Tp,_Alloc>:: @@ -148,17 +148,17 @@ namespace __gnu_norm else erase(__i, end()); } - + template<typename _Tp, typename _Alloc> template <typename _InputIterator> void list<_Tp,_Alloc>:: - _M_assign_dispatch(_InputIterator __first2, _InputIterator __last2, + _M_assign_dispatch(_InputIterator __first2, _InputIterator __last2, __false_type) { iterator __first1 = begin(); iterator __last1 = end(); - for (; __first1 != __last1 && __first2 != __last2; + for (; __first1 != __last1 && __first2 != __last2; ++__first1, ++__first2) *__first1 = *__first2; if (__first2 == __last2) @@ -166,7 +166,7 @@ namespace __gnu_norm else insert(__last1, __first2, __last2); } - + template<typename _Tp, typename _Alloc> void list<_Tp,_Alloc>:: @@ -183,7 +183,7 @@ namespace __gnu_norm __first = __next; } } - + template<typename _Tp, typename _Alloc> void list<_Tp,_Alloc>:: @@ -203,7 +203,7 @@ namespace __gnu_norm __next = __first; } } - + template<typename _Tp, typename _Alloc> void list<_Tp,_Alloc>:: @@ -230,14 +230,14 @@ namespace __gnu_norm _M_transfer(__last1, __first2, __last2); } } - + template<typename _Tp, typename _Alloc> void list<_Tp,_Alloc>:: sort() { // Do nothing if the list has length 0 or 1. - if (this->_M_node._M_next != &this->_M_node + if (this->_M_node._M_next != &this->_M_node && this->_M_node._M_next->_M_next != &this->_M_node) { list __carry; @@ -248,7 +248,7 @@ namespace __gnu_norm do { __carry.splice(__carry.begin(), *this, begin()); - + for(__counter = &__tmp[0]; (__counter != __fill) && !__counter->empty(); ++__counter) @@ -267,7 +267,7 @@ namespace __gnu_norm swap( *(__fill-1) ); } } - + template<typename _Tp, typename _Alloc> template <typename _Predicate> void @@ -285,7 +285,7 @@ namespace __gnu_norm __first = __next; } } - + template<typename _Tp, typename _Alloc> template <typename _BinaryPredicate> void @@ -305,7 +305,7 @@ namespace __gnu_norm __next = __first; } } - + template<typename _Tp, typename _Alloc> template <typename _StrictWeakOrdering> void @@ -313,7 +313,7 @@ namespace __gnu_norm merge(list& __x, _StrictWeakOrdering __comp) { // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 300. list::merge() specification incomplete + // 300. list::merge() specification incomplete if (this != &__x) { iterator __first1 = begin(); @@ -333,7 +333,7 @@ namespace __gnu_norm _M_transfer(__last1, __first2, __last2); } } - + template<typename _Tp, typename _Alloc> template <typename _StrictWeakOrdering> void @@ -348,11 +348,11 @@ namespace __gnu_norm list __tmp[64]; list * __fill = &__tmp[0]; list * __counter; - + do { __carry.splice(__carry.begin(), *this, begin()); - + for(__counter = &__tmp[0]; (__counter != __fill) && !__counter->empty(); ++__counter) @@ -365,7 +365,7 @@ namespace __gnu_norm ++__fill; } while ( !empty() ); - + for (__counter = &__tmp[1]; __counter != __fill; ++__counter) __counter->merge( *(__counter-1), __comp ); swap( *(__fill-1) ); diff --git a/libstdc++-v3/include/bits/locale_classes.h b/libstdc++-v3/include/bits/locale_classes.h index 52bf1fc9c31..33eb47576db 100644 --- a/libstdc++-v3/include/bits/locale_classes.h +++ b/libstdc++-v3/include/bits/locale_classes.h @@ -80,16 +80,16 @@ namespace std friend class _Impl; template<typename _Facet> - friend bool + friend bool has_facet(const locale&) throw(); template<typename _Facet> - friend const _Facet& + friend const _Facet& use_facet(const locale&); template<typename _Cache> friend struct __use_cache; - + //@{ /** * @brief Category values. @@ -103,18 +103,18 @@ namespace std * @endif */ static const category none = 0; - static const category ctype = 1L << 0; - static const category numeric = 1L << 1; - static const category collate = 1L << 2; - static const category time = 1L << 3; - static const category monetary = 1L << 4; - static const category messages = 1L << 5; - static const category all = (ctype | numeric | collate | - time | monetary | messages); + static const category ctype = 1L << 0; + static const category numeric = 1L << 1; + static const category collate = 1L << 2; + static const category time = 1L << 3; + static const category monetary = 1L << 4; + static const category messages = 1L << 5; + static const category all = (ctype | numeric | collate | + time | monetary | messages); //@} // Construct/copy/destroy: - + /** * @brief Default constructor. * @@ -140,7 +140,7 @@ namespace std * @param s Name of the locale to construct. * @throw std::runtime_error if s is null or an undefined locale. */ - explicit + explicit locale(const char* __s); /** @@ -152,7 +152,7 @@ namespace std * * @param base The locale to copy. * @param s Name of the locale to use facets from. - * @param cat Set of categories defining the facets to use from s. + * @param cat Set of categories defining the facets to use from s. * @throw std::runtime_error if s is null or an undefined locale. */ locale(const locale& __base, const char* __s, category __cat); @@ -210,7 +210,7 @@ namespace std * @throw std::runtime_error if other has no facet of type Facet. */ template<typename _Facet> - locale + locale combine(const locale& __other) const; // Locale operations: @@ -218,7 +218,7 @@ namespace std * @brief Return locale name. * @return Locale name or "*" if unnamed. */ - string + string name() const; /** @@ -226,9 +226,9 @@ namespace std * * @param other The locale to compare against. * @return True if other and this refer to the same locale instance, are - * copies, or have the same name. False otherwise. + * copies, or have the same name. False otherwise. */ - bool + bool operator==(const locale& __other) const throw (); /** @@ -237,7 +237,7 @@ namespace std * @param other The locale to compare against. * @return ! (*this == other) */ - inline bool + inline bool operator!=(const locale& __other) const throw () { return !(this->operator==(__other)); } @@ -257,7 +257,7 @@ namespace std * @return True if collate<Char> facet compares s1 < s2, else false. */ template<typename _Char, typename _Traits, typename _Alloc> - bool + bool operator()(const basic_string<_Char, _Traits, _Alloc>& __s1, const basic_string<_Char, _Traits, _Alloc>& __s2) const; @@ -272,26 +272,26 @@ namespace std * @param locale The new locale to make global. * @return Copy of the old global locale. */ - static locale + static locale global(const locale&); /** * @brief Return reference to the "C" locale. */ - static const locale& + static const locale& classic(); private: // The (shared) implementation - _Impl* _M_impl; + _Impl* _M_impl; // The "C" reference locale static _Impl* _S_classic; // Current global locale - static _Impl* _S_global; + static _Impl* _S_global; - // Names of underlying locale categories. + // Names of underlying locale categories. // NB: locale::global() has to know how to modify all the // underlying categories, not just the ones required by the C++ // standard. @@ -313,16 +313,16 @@ namespace std static __gthread_once_t _S_once; #endif - explicit + explicit locale(_Impl*) throw(); - static void + static void _S_initialize(); static void _S_initialize_once(); - static category + static category _S_normalize_category(category); void @@ -355,10 +355,10 @@ namespace std static const char _S_c_name[2]; #ifdef __GTHREADS - static __gthread_once_t _S_once; + static __gthread_once_t _S_once; #endif - static void + static void _S_initialize_once(); protected: @@ -371,16 +371,16 @@ namespace std * * @param refs The initial value for reference count. */ - explicit + explicit facet(size_t __refs = 0) throw() : _M_refcount(__refs ? 1 : 0) { } /// Facet destructor. - virtual + virtual ~facet(); static void - _S_create_c_locale(__c_locale& __cloc, const char* __s, + _S_create_c_locale(__c_locale& __cloc, const char* __s, __c_locale __old = 0); static __c_locale @@ -407,16 +407,16 @@ namespace std { if (__exchange_and_add(&_M_refcount, -1) == 1) { - try - { delete this; } - catch (...) + try + { delete this; } + catch (...) { } } } facet(const facet&); // Not defined. - void + void operator=(const facet&); // Not defined. }; @@ -438,22 +438,22 @@ namespace std friend class locale::_Impl; template<typename _Facet> - friend const _Facet& + friend const _Facet& use_facet(const locale&); template<typename _Facet> - friend bool + friend bool has_facet(const locale&) throw (); // NB: There is no accessor for _M_index because it may be used // before the constructor is run; the effect of calling a member // function (even an inline) would be undefined. - mutable size_t _M_index; + mutable size_t _M_index; // Last id number assigned. - static _Atomic_word _S_refcount; + static _Atomic_word _S_refcount; - void + void operator=(const id&); // Not defined. id(const id&); // Not defined. @@ -478,11 +478,11 @@ namespace std friend class locale::facet; template<typename _Facet> - friend bool + friend bool has_facet(const locale&) throw(); template<typename _Facet> - friend const _Facet& + friend const _Facet& use_facet(const locale&); template<typename _Cache> @@ -492,29 +492,29 @@ namespace std // Data Members. _Atomic_word _M_refcount; const facet** _M_facets; - size_t _M_facets_size; + size_t _M_facets_size; const facet** _M_caches; - char** _M_names; - static const locale::id* const _S_id_ctype[]; - static const locale::id* const _S_id_numeric[]; - static const locale::id* const _S_id_collate[]; - static const locale::id* const _S_id_time[]; - static const locale::id* const _S_id_monetary[]; - static const locale::id* const _S_id_messages[]; + char** _M_names; + static const locale::id* const _S_id_ctype[]; + static const locale::id* const _S_id_numeric[]; + static const locale::id* const _S_id_collate[]; + static const locale::id* const _S_id_time[]; + static const locale::id* const _S_id_monetary[]; + static const locale::id* const _S_id_messages[]; static const locale::id* const* const _S_facet_categories[]; - inline void + inline void _M_add_reference() throw() { __atomic_add(&_M_refcount, 1); } - inline void + inline void _M_remove_reference() throw() { if (__exchange_and_add(&_M_refcount, -1) == 1) { - try - { delete this; } - catch(...) + try + { delete this; } + catch(...) { } } } @@ -527,7 +527,7 @@ namespace std _Impl(const _Impl&); // Not defined. - void + void operator=(const _Impl&); // Not defined. inline bool @@ -539,29 +539,29 @@ namespace std return __ret; } - void + void _M_replace_categories(const _Impl*, category); - void + void _M_replace_category(const _Impl*, const locale::id* const*); - void + void _M_replace_facet(const _Impl*, const locale::id*); - void + void _M_install_facet(const locale::id*, const facet*); template<typename _Facet> - inline void + inline void _M_init_facet(_Facet* __facet) { _M_install_facet(&_Facet::id, __facet); } void _M_install_cache(const facet* __cache, size_t __index) throw() - { + { __cache->_M_add_reference(); - _M_caches[__index] = __cache; - } + _M_caches[__index] = __cache; + } }; template<typename _Facet> @@ -584,7 +584,7 @@ namespace std { _M_impl->_M_remove_reference(); for (size_t __j = 0; __j < __i; ++__j) - delete [] _M_tmp_names[__j]; + delete [] _M_tmp_names[__j]; __throw_exception_again; } diff --git a/libstdc++-v3/include/bits/locale_facets.h b/libstdc++-v3/include/bits/locale_facets.h index 3b1315d3f27..14fb84c1555 100644 --- a/libstdc++-v3/include/bits/locale_facets.h +++ b/libstdc++-v3/include/bits/locale_facets.h @@ -57,28 +57,28 @@ namespace std # define _GLIBCXX_NUM_FACETS 14 #endif - // Convert string to numeric value of type _Tv and store results. + // Convert string to numeric value of type _Tv and store results. // NB: This is specialized for all required types, there is no // generic definition. template<typename _Tv> void - __convert_to_v(const char* __in, _Tv& __out, ios_base::iostate& __err, + __convert_to_v(const char* __in, _Tv& __out, ios_base::iostate& __err, const __c_locale& __cloc); // Explicit specializations for required types. template<> void - __convert_to_v(const char*, float&, ios_base::iostate&, + __convert_to_v(const char*, float&, ios_base::iostate&, const __c_locale&); template<> void - __convert_to_v(const char*, double&, ios_base::iostate&, + __convert_to_v(const char*, double&, ios_base::iostate&, const __c_locale&); template<> void - __convert_to_v(const char*, long double&, ios_base::iostate&, + __convert_to_v(const char*, long double&, ios_base::iostate&, const __c_locale&); // NB: __pad is a struct, rather than a function, so it can be @@ -87,8 +87,8 @@ namespace std struct __pad { static void - _S_pad(ios_base& __io, _CharT __fill, _CharT* __news, - const _CharT* __olds, const streamsize __newlen, + _S_pad(ios_base& __io, _CharT __fill, _CharT* __news, + const _CharT* __olds, const streamsize __newlen, const streamsize __oldlen, const bool __num); }; @@ -99,8 +99,8 @@ namespace std // only with __glen != 0. template<typename _CharT> _CharT* - __add_grouping(_CharT* __s, _CharT __sep, - const char* __gbeg, size_t __gsize, + __add_grouping(_CharT* __s, _CharT __sep, + const char* __gbeg, size_t __gsize, const _CharT* __first, const _CharT* __last); // This template permits specializing facet output code for @@ -131,7 +131,7 @@ namespace std // Include host and configuration specific ctype enums for ctype_base. #include <bits/ctype_base.h> - // Common base for ctype<_CharT>. + // Common base for ctype<_CharT>. /** * @brief Common base for ctype facet * @@ -159,7 +159,7 @@ namespace std * @param m The mask to compare against. * @return (M & m) != 0. */ - bool + bool is(mask __m, char_type __c) const { return this->do_is(__m, __c); } @@ -177,7 +177,7 @@ namespace std * @return @a hi. */ const char_type* - is(const char_type *__lo, const char_type *__hi, mask *__vec) const + is(const char_type *__lo, const char_type *__hi, mask *__vec) const { return this->do_is(__lo, __hi, __vec); } /** @@ -222,7 +222,7 @@ namespace std * @param c The char_type to convert. * @return The uppercase char_type if convertible, else @a c. */ - char_type + char_type toupper(char_type __c) const { return this->do_toupper(__c); } @@ -321,7 +321,7 @@ namespace std * @param dfault Char to return if conversion fails. * @return The converted char. */ - char + char narrow(char_type __c, char __dfault) const { return this->do_narrow(__c, __dfault); } @@ -349,12 +349,12 @@ namespace std { return this->do_narrow(__lo, __hi, __dfault, __to); } protected: - explicit + explicit __ctype_abstract_base(size_t __refs = 0): facet(__refs) { } - virtual + virtual ~__ctype_abstract_base() { } - + /** * @brief Test char_type classification. * @@ -388,7 +388,7 @@ namespace std * @return @a hi. */ virtual const char_type* - do_is(const char_type* __lo, const char_type* __hi, + do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const = 0; /** @@ -426,7 +426,7 @@ namespace std * @return Pointer to a non-matching char_type if found, else @a hi. */ virtual const char_type* - do_scan_not(mask __m, const char_type* __lo, + do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const = 0; /** @@ -443,7 +443,7 @@ namespace std * @param c The char_type to convert. * @return The uppercase char_type if convertible, else @a c. */ - virtual char_type + virtual char_type do_toupper(char_type) const = 0; /** @@ -495,7 +495,7 @@ namespace std */ virtual const char_type* do_tolower(char_type* __lo, const char_type* __hi) const = 0; - + /** * @brief Widen char * @@ -512,7 +512,7 @@ namespace std * @param c The char to convert. * @return The converted char_type */ - virtual char_type + virtual char_type do_widen(char) const = 0; /** @@ -534,7 +534,7 @@ namespace std * @return @a hi. */ virtual const char* - do_widen(const char* __lo, const char* __hi, + do_widen(const char* __lo, const char* __hi, char_type* __dest) const = 0; /** @@ -555,7 +555,7 @@ namespace std * @param dfault Char to return if conversion fails. * @return The converted char. */ - virtual char + virtual char do_narrow(char_type, char __dfault) const = 0; /** @@ -607,20 +607,20 @@ namespace std { public: // Types: - typedef _CharT char_type; + typedef _CharT char_type; typedef typename __ctype_abstract_base<_CharT>::mask mask; /// The facet id for ctype<char_type> - static locale::id id; + static locale::id id; - explicit + explicit ctype(size_t __refs = 0) : __ctype_abstract_base<_CharT>(__refs) { } protected: - virtual + virtual ~ctype(); - virtual bool + virtual bool do_is(mask __m, char_type __c) const; virtual const char_type* @@ -633,25 +633,25 @@ namespace std do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const; - virtual char_type + virtual char_type do_toupper(char_type __c) const; virtual const char_type* do_toupper(char_type* __lo, const char_type* __hi) const; - virtual char_type + virtual char_type do_tolower(char_type __c) const; virtual const char_type* do_tolower(char_type* __lo, const char_type* __hi) const; - virtual char_type + virtual char_type do_widen(char __c) const; virtual const char* do_widen(const char* __lo, const char* __hi, char_type* __dest) const; - virtual char + virtual char do_narrow(char_type, char __dfault) const; virtual const char_type* @@ -677,21 +677,21 @@ namespace std public: // Types: /// Typedef for the template parameter char. - typedef char char_type; + typedef char char_type; protected: // Data Members: __c_locale _M_c_locale_ctype; - bool _M_del; - __to_type _M_toupper; - __to_type _M_tolower; - const mask* _M_table; + bool _M_del; + __to_type _M_toupper; + __to_type _M_tolower; + const mask* _M_table; mutable char _M_widen_ok; mutable char _M_widen[1 + static_cast<unsigned char>(-1)]; mutable char _M_narrow[1 + static_cast<unsigned char>(-1)]; mutable char _M_narrow_ok; // 0 uninitialized, 1 init, // 2 non-consecutive - + public: /// The facet id for ctype<char> static locale::id id; @@ -708,7 +708,7 @@ namespace std * @param del If true, passes ownership of table to this facet. * @param refs Passed to the base facet class. */ - explicit + explicit ctype(const mask* __table = 0, bool __del = false, size_t __refs = 0); /** @@ -721,8 +721,8 @@ namespace std * @param del If true, passes ownership of table to this facet. * @param refs Passed to the base facet class. */ - explicit - ctype(__c_locale __cloc, const mask* __table = 0, bool __del = false, + explicit + ctype(__c_locale __cloc, const mask* __table = 0, bool __del = false, size_t __refs = 0); /** @@ -736,7 +736,7 @@ namespace std */ inline bool is(mask __m, char __c) const; - + /** * @brief Return a mask array. * @@ -751,7 +751,7 @@ namespace std */ inline const char* is(const char* __lo, const char* __hi, mask* __vec) const; - + /** * @brief Find char matching a mask * @@ -779,7 +779,7 @@ namespace std */ inline const char* scan_not(mask __m, const char* __lo, const char* __hi) const; - + /** * @brief Convert to uppercase. * @@ -792,7 +792,7 @@ namespace std * @param c The char to convert. * @return The uppercase char if convertible, else @a c. */ - char_type + char_type toupper(char_type __c) const { return this->do_toupper(__c); } @@ -825,7 +825,7 @@ namespace std * @param c The char to convert. * @return The lowercase char if convertible, else @a c. */ - char_type + char_type tolower(char_type __c) const { return this->do_tolower(__c); } @@ -862,9 +862,9 @@ namespace std * @param c The char to convert. * @return The converted character. */ - char_type + char_type widen(char __c) const - { + { if (_M_widen_ok) return _M_widen[static_cast<unsigned char>(__c)]; this->_M_widen_init(); return this->do_widen(__c); @@ -918,7 +918,7 @@ namespace std * @param dfault Char to return if conversion fails. * @return The converted character. */ - char + char narrow(char_type __c, char __dfault) const { if (_M_narrow[static_cast<unsigned char>(__c)]) @@ -967,12 +967,12 @@ namespace std protected: /// Returns a pointer to the mask table provided to the constructor, or /// the default from classic_table() if none was provided. - const mask* + const mask* table() const throw() { return _M_table; } /// Returns a pointer to the C locale mask table. - static const mask* + static const mask* classic_table() throw(); /** @@ -981,7 +981,7 @@ namespace std * This function deletes table() if @a del was true in the * constructor. */ - virtual + virtual ~ctype(); /** @@ -997,7 +997,7 @@ namespace std * @param c The char to convert. * @return The uppercase char if convertible, else @a c. */ - virtual char_type + virtual char_type do_toupper(char_type) const; /** @@ -1030,7 +1030,7 @@ namespace std * @param c The char to convert. * @return The lowercase char if convertible, else @a c. */ - virtual char_type + virtual char_type do_tolower(char_type) const; /** @@ -1049,7 +1049,7 @@ namespace std */ virtual const char_type* do_tolower(char_type* __lo, const char_type* __hi) const; - + /** * @brief Widen char * @@ -1067,7 +1067,7 @@ namespace std * @param c The char to convert. * @return The converted character. */ - virtual char_type + virtual char_type do_widen(char __c) const { return __c; } @@ -1116,7 +1116,7 @@ namespace std * @param dfault Char to return if conversion fails. * @return The converted char. */ - virtual char + virtual char do_narrow(char_type __c, char) const { return __c; } @@ -1158,7 +1158,7 @@ namespace std for (size_t __i = 0; __i < sizeof(_M_widen); ++__i) __tmp[__i] = __i; do_widen(__tmp, __tmp + sizeof(__tmp), _M_widen); - + _M_widen_ok = 1; // Set _M_widen_ok to 2 if memcpy can't be used. for (size_t __i = 0; __i < sizeof(_M_widen); ++__i) @@ -1196,7 +1196,7 @@ namespace std _M_narrow_ok = __consecutive ? 1 : 2; } }; - + template<> const ctype<char>& use_facet<ctype<char> >(const locale& __loc); @@ -1219,8 +1219,8 @@ namespace std public: // Types: /// Typedef for the template parameter wchar_t. - typedef wchar_t char_type; - typedef wctype_t __wmask_type; + typedef wchar_t char_type; + typedef wctype_t __wmask_type; protected: __c_locale _M_c_locale_ctype; @@ -1237,7 +1237,7 @@ namespace std public: // Data Members: /// The facet id for ctype<wchar_t> - static locale::id id; + static locale::id id; /** * @brief Constructor performs initialization. @@ -1246,7 +1246,7 @@ namespace std * * @param refs Passed to the base facet class. */ - explicit + explicit ctype(size_t __refs = 0); /** @@ -1257,7 +1257,7 @@ namespace std * @param cloc Handle to C locale data. * @param refs Passed to the base facet class. */ - explicit + explicit ctype(__c_locale __cloc, size_t __refs = 0); protected: @@ -1265,7 +1265,7 @@ namespace std _M_convert_to_wmask(const mask __m) const; /// Destructor - virtual + virtual ~ctype(); /** @@ -1281,7 +1281,7 @@ namespace std * @param m The mask to compare against. * @return (M & m) != 0. */ - virtual bool + virtual bool do_is(mask __m, char_type __c) const; /** @@ -1337,7 +1337,7 @@ namespace std * @return Pointer to a non-matching wchar_t if found, else @a hi. */ virtual const char_type* - do_scan_not(mask __m, const char_type* __lo, + do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const; /** @@ -1353,7 +1353,7 @@ namespace std * @param c The wchar_t to convert. * @return The uppercase wchar_t if convertible, else @a c. */ - virtual char_type + virtual char_type do_toupper(char_type) const; /** @@ -1386,7 +1386,7 @@ namespace std * @param c The wchar_t to convert. * @return The lowercase wchar_t if convertible, else @a c. */ - virtual char_type + virtual char_type do_tolower(char_type) const; /** @@ -1405,7 +1405,7 @@ namespace std */ virtual const char_type* do_tolower(char_type* __lo, const char_type* __hi) const; - + /** * @brief Widen char to wchar_t * @@ -1423,7 +1423,7 @@ namespace std * @param c The char to convert. * @return The converted wchar_t. */ - virtual char_type + virtual char_type do_widen(char) const; /** @@ -1467,7 +1467,7 @@ namespace std * @param dfault Char to return if conversion fails. * @return The converted char. */ - virtual char + virtual char do_narrow(char_type, char __dfault) const; /** @@ -1498,7 +1498,7 @@ namespace std char __dfault, char* __dest) const; // For use at construction time only. - void + void _M_initialize_ctype(); }; @@ -1515,13 +1515,13 @@ namespace std class ctype_byname : public ctype<_CharT> { public: - typedef _CharT char_type; + typedef _CharT char_type; - explicit + explicit ctype_byname(const char* __s, size_t __refs = 0); protected: - virtual + virtual ~ctype_byname() { }; }; @@ -1536,26 +1536,26 @@ namespace std #include <bits/codecvt.h> // 22.2.2 The numeric category. - class __num_base + class __num_base { public: // NB: Code depends on the order of _S_atoms_out elements. // Below are the indices into _S_atoms_out. - enum - { - _S_ominus, - _S_oplus, - _S_ox, - _S_oX, + enum + { + _S_ominus, + _S_oplus, + _S_ox, + _S_oX, _S_odigits, _S_odigits_end = _S_odigits + 16, - _S_oudigits = _S_odigits_end, + _S_oudigits = _S_odigits_end, _S_oudigits_end = _S_oudigits + 16, _S_oe = _S_odigits + 14, // For scientific notation, 'e' _S_oE = _S_oudigits + 14, // For scientific notation, 'E' _S_oend = _S_oudigits_end }; - + // A list of valid numeric literals for output. This array // contains chars that will be passed through the current locale's // ctype<_CharT>.widen() and then used to render numbers. @@ -1567,12 +1567,12 @@ namespace std // "-+xX0123456789abcdefABCDEF" static const char* _S_atoms_in; - enum - { - _S_iminus, - _S_iplus, - _S_ix, - _S_iX, + enum + { + _S_iminus, + _S_iplus, + _S_ix, + _S_iX, _S_izero, _S_ie = _S_izero + 14, _S_iE = _S_izero + 20, @@ -1588,36 +1588,36 @@ namespace std template<typename _CharT> struct __numpunct_cache : public locale::facet { - const char* _M_grouping; + const char* _M_grouping; size_t _M_grouping_size; bool _M_use_grouping; - const _CharT* _M_truename; + const _CharT* _M_truename; size_t _M_truename_size; const _CharT* _M_falsename; - size_t _M_falsename_size; - _CharT _M_decimal_point; - _CharT _M_thousands_sep; - + size_t _M_falsename_size; + _CharT _M_decimal_point; + _CharT _M_thousands_sep; + // A list of valid numeric literals for output: in the standard // "C" locale, this is "-+xX0123456789abcdef0123456789ABCDEF". // This array contains the chars after having been passed // through the current locale's ctype<_CharT>.widen(). - _CharT _M_atoms_out[__num_base::_S_oend]; + _CharT _M_atoms_out[__num_base::_S_oend]; // A list of valid numeric literals for input: in the standard // "C" locale, this is "-+xX0123456789abcdefABCDEF" // This array contains the chars after having been passed // through the current locale's ctype<_CharT>.widen(). - _CharT _M_atoms_in[__num_base::_S_iend]; + _CharT _M_atoms_in[__num_base::_S_iend]; bool _M_allocated; - __numpunct_cache(size_t __refs = 0) : facet(__refs), + __numpunct_cache(size_t __refs = 0) : facet(__refs), _M_grouping(NULL), _M_grouping_size(0), _M_use_grouping(false), _M_truename(NULL), _M_truename_size(0), _M_falsename(NULL), _M_falsename_size(0), _M_decimal_point(_CharT()), _M_thousands_sep(_CharT()), _M_allocated(false) - { } + { } ~__numpunct_cache(); @@ -1648,14 +1648,14 @@ namespace std _CharT* __falsename = new _CharT[_M_falsename_size]; __np.falsename().copy(__falsename, _M_falsename_size); _M_falsename = __falsename; - + _M_decimal_point = __np.decimal_point(); _M_thousands_sep = __np.thousands_sep(); - + const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc); - __ct.widen(__num_base::_S_atoms_out, + __ct.widen(__num_base::_S_atoms_out, __num_base::_S_atoms_out + __num_base::_S_oend, _M_atoms_out); - __ct.widen(__num_base::_S_atoms_in, + __ct.widen(__num_base::_S_atoms_in, __num_base::_S_atoms_in + __num_base::_S_iend, _M_atoms_in); } @@ -1690,8 +1690,8 @@ namespace std // Types: //@{ /// Public typedefs - typedef _CharT char_type; - typedef basic_string<_CharT> string_type; + typedef _CharT char_type; + typedef basic_string<_CharT> string_type; //@} typedef __numpunct_cache<_CharT> __cache_type; @@ -1700,14 +1700,14 @@ namespace std public: /// Numpunct facet id. - static locale::id id; + static locale::id id; /** * @brief Numpunct constructor. * * @param refs Refcount to pass to the base class. */ - explicit + explicit numpunct(size_t __refs = 0) : facet(__refs), _M_data(NULL) { _M_initialize_numpunct(); } @@ -1720,8 +1720,8 @@ namespace std * @param cache __numpunct_cache object. * @param refs Refcount to pass to the base class. */ - explicit - numpunct(__cache_type* __cache, size_t __refs = 0) + explicit + numpunct(__cache_type* __cache, size_t __refs = 0) : facet(__refs), _M_data(__cache) { _M_initialize_numpunct(); } @@ -1734,8 +1734,8 @@ namespace std * @param cloc The "C" locale. * @param refs Refcount to pass to the base class. */ - explicit - numpunct(__c_locale __cloc, size_t __refs = 0) + explicit + numpunct(__c_locale __cloc, size_t __refs = 0) : facet(__refs), _M_data(NULL) { _M_initialize_numpunct(__cloc); } @@ -1748,7 +1748,7 @@ namespace std * * @return @a char_type representing a decimal point. */ - char_type + char_type decimal_point() const { return this->do_decimal_point(); } @@ -1761,7 +1761,7 @@ namespace std * * @return char_type representing a thousands separator. */ - char_type + char_type thousands_sep() const { return this->do_thousands_sep(); } @@ -1790,7 +1790,7 @@ namespace std * * @return string representing grouping specification. */ - string + string grouping() const { return this->do_grouping(); } @@ -1803,7 +1803,7 @@ namespace std * * @return string_type representing printed form of true. */ - string_type + string_type truename() const { return this->do_truename(); } @@ -1816,13 +1816,13 @@ namespace std * * @return string_type representing printed form of false. */ - string_type + string_type falsename() const { return this->do_falsename(); } protected: /// Destructor. - virtual + virtual ~numpunct(); /** @@ -1833,7 +1833,7 @@ namespace std * * @return @a char_type representing a decimal point. */ - virtual char_type + virtual char_type do_decimal_point() const { return _M_data->_M_decimal_point; } @@ -1845,7 +1845,7 @@ namespace std * * @return @a char_type representing a thousands separator. */ - virtual char_type + virtual char_type do_thousands_sep() const { return _M_data->_M_thousands_sep; } @@ -1889,25 +1889,25 @@ namespace std { return _M_data->_M_falsename; } // For use at construction time only. - void + void _M_initialize_numpunct(__c_locale __cloc = NULL); }; template<typename _CharT> locale::id numpunct<_CharT>::id; - template<> + template<> numpunct<char>::~numpunct(); - template<> + template<> void numpunct<char>::_M_initialize_numpunct(__c_locale __cloc); #ifdef _GLIBCXX_USE_WCHAR_T - template<> + template<> numpunct<wchar_t>::~numpunct(); - template<> + template<> void numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc); #endif @@ -1916,10 +1916,10 @@ namespace std class numpunct_byname : public numpunct<_CharT> { public: - typedef _CharT char_type; - typedef basic_string<_CharT> string_type; + typedef _CharT char_type; + typedef basic_string<_CharT> string_type; - explicit + explicit numpunct_byname(const char* __s, size_t __refs = 0) : numpunct<_CharT>(__refs) { @@ -1927,14 +1927,14 @@ namespace std { __c_locale __tmp; this->_S_create_c_locale(__tmp, __s); - this->_M_initialize_numpunct(__tmp); - this->_S_destroy_c_locale(__tmp); + this->_M_initialize_numpunct(__tmp); + this->_S_destroy_c_locale(__tmp); } } protected: - virtual - ~numpunct_byname() { } + virtual + ~numpunct_byname() { } }; /** @@ -1956,12 +1956,12 @@ namespace std // Types: //@{ /// Public typedefs - typedef _CharT char_type; - typedef _InIter iter_type; + typedef _CharT char_type; + typedef _InIter iter_type; //@} /// Numpunct facet id. - static locale::id id; + static locale::id id; /** * @brief Constructor performs initialization. @@ -1970,7 +1970,7 @@ namespace std * * @param refs Passed to the base facet class. */ - explicit + explicit num_get(size_t __refs = 0) : facet(__refs) { } /** @@ -1995,7 +1995,7 @@ namespace std * @param v Value to format and insert. * @return Iterator after reading. */ - iter_type + iter_type get(iter_type __in, iter_type __end, ios_base& __io, ios_base::iostate& __err, bool& __v) const { return this->do_get(__in, __end, __io, __err, __v); } @@ -2032,32 +2032,32 @@ namespace std * @return Iterator after reading. */ iter_type - get(iter_type __in, iter_type __end, ios_base& __io, + get(iter_type __in, iter_type __end, ios_base& __io, ios_base::iostate& __err, long& __v) const { return this->do_get(__in, __end, __io, __err, __v); } - iter_type + iter_type get(iter_type __in, iter_type __end, ios_base& __io, ios_base::iostate& __err, unsigned short& __v) const { return this->do_get(__in, __end, __io, __err, __v); } - iter_type + iter_type get(iter_type __in, iter_type __end, ios_base& __io, ios_base::iostate& __err, unsigned int& __v) const { return this->do_get(__in, __end, __io, __err, __v); } - iter_type + iter_type get(iter_type __in, iter_type __end, ios_base& __io, ios_base::iostate& __err, unsigned long& __v) const { return this->do_get(__in, __end, __io, __err, __v); } #ifdef _GLIBCXX_USE_LONG_LONG - iter_type + iter_type get(iter_type __in, iter_type __end, ios_base& __io, ios_base::iostate& __err, long long& __v) const { return this->do_get(__in, __end, __io, __err, __v); } - iter_type + iter_type get(iter_type __in, iter_type __end, ios_base& __io, ios_base::iostate& __err, unsigned long long& __v) const { return this->do_get(__in, __end, __io, __err, __v); } @@ -2090,17 +2090,17 @@ namespace std * @param v Value to format and insert. * @return Iterator after reading. */ - iter_type + iter_type get(iter_type __in, iter_type __end, ios_base& __io, ios_base::iostate& __err, float& __v) const { return this->do_get(__in, __end, __io, __err, __v); } - iter_type + iter_type get(iter_type __in, iter_type __end, ios_base& __io, ios_base::iostate& __err, double& __v) const { return this->do_get(__in, __end, __io, __err, __v); } - iter_type + iter_type get(iter_type __in, iter_type __end, ios_base& __io, ios_base::iostate& __err, long double& __v) const { return this->do_get(__in, __end, __io, __err, __v); } @@ -2132,22 +2132,22 @@ namespace std * @param v Value to format and insert. * @return Iterator after reading. */ - iter_type + iter_type get(iter_type __in, iter_type __end, ios_base& __io, ios_base::iostate& __err, void*& __v) const - { return this->do_get(__in, __end, __io, __err, __v); } + { return this->do_get(__in, __end, __io, __err, __v); } protected: /// Destructor. virtual ~num_get() { } - iter_type - _M_extract_float(iter_type, iter_type, ios_base&, ios_base::iostate&, + iter_type + _M_extract_float(iter_type, iter_type, ios_base&, ios_base::iostate&, string& __xtrc) const; template<typename _ValueT> - iter_type - _M_extract_int(iter_type, iter_type, ios_base&, ios_base::iostate&, + iter_type + _M_extract_int(iter_type, iter_type, ios_base&, ios_base::iostate&, _ValueT& __v) const; //@{ @@ -2165,49 +2165,49 @@ namespace std * @param v Value to format and insert. * @return Iterator after reading. */ - virtual iter_type + virtual iter_type do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, bool&) const; - virtual iter_type + virtual iter_type do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, long&) const; - virtual iter_type - do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, + virtual iter_type + do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, unsigned short&) const; - virtual iter_type - do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, + virtual iter_type + do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, unsigned int&) const; - virtual iter_type - do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, + virtual iter_type + do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, unsigned long&) const; -#ifdef _GLIBCXX_USE_LONG_LONG - virtual iter_type - do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, +#ifdef _GLIBCXX_USE_LONG_LONG + virtual iter_type + do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, long long&) const; - virtual iter_type - do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, + virtual iter_type + do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, unsigned long long&) const; #endif - virtual iter_type - do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, + virtual iter_type + do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, float&) const; - virtual iter_type - do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, + virtual iter_type + do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, double&) const; - virtual iter_type - do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, + virtual iter_type + do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, long double&) const; - virtual iter_type - do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, + virtual iter_type + do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, void*&) const; //@} }; @@ -2234,8 +2234,8 @@ namespace std // Types: //@{ /// Public typedefs - typedef _CharT char_type; - typedef _OutIter iter_type; + typedef _CharT char_type; + typedef _OutIter iter_type; //@} /// Numpunct facet id. @@ -2248,7 +2248,7 @@ namespace std * * @param refs Passed to the base facet class. */ - explicit + explicit num_put(size_t __refs = 0) : facet(__refs) { } /** @@ -2266,7 +2266,7 @@ namespace std * @param v Value to format and insert. * @return Iterator after writing. */ - iter_type + iter_type put(iter_type __s, ios_base& __f, char_type __fill, bool __v) const { return this->do_put(__s, __f, __fill, __v); } @@ -2308,22 +2308,22 @@ namespace std * @param v Value to format and insert. * @return Iterator after writing. */ - iter_type + iter_type put(iter_type __s, ios_base& __f, char_type __fill, long __v) const { return this->do_put(__s, __f, __fill, __v); } - iter_type - put(iter_type __s, ios_base& __f, char_type __fill, + iter_type + put(iter_type __s, ios_base& __f, char_type __fill, unsigned long __v) const { return this->do_put(__s, __f, __fill, __v); } -#ifdef _GLIBCXX_USE_LONG_LONG - iter_type +#ifdef _GLIBCXX_USE_LONG_LONG + iter_type put(iter_type __s, ios_base& __f, char_type __fill, long long __v) const { return this->do_put(__s, __f, __fill, __v); } - iter_type - put(iter_type __s, ios_base& __f, char_type __fill, + iter_type + put(iter_type __s, ios_base& __f, char_type __fill, unsigned long long __v) const { return this->do_put(__s, __f, __fill, __v); } #endif @@ -2371,12 +2371,12 @@ namespace std * @param v Value to format and insert. * @return Iterator after writing. */ - iter_type + iter_type put(iter_type __s, ios_base& __f, char_type __fill, double __v) const { return this->do_put(__s, __f, __fill, __v); } - iter_type - put(iter_type __s, ios_base& __f, char_type __fill, + iter_type + put(iter_type __s, ios_base& __f, char_type __fill, long double __v) const { return this->do_put(__s, __f, __fill, __v); } //@} @@ -2396,15 +2396,15 @@ namespace std * @param v Value to format and insert. * @return Iterator after writing. */ - iter_type - put(iter_type __s, ios_base& __f, char_type __fill, + iter_type + put(iter_type __s, ios_base& __f, char_type __fill, const void* __v) const { return this->do_put(__s, __f, __fill, __v); } protected: template<typename _ValueT> iter_type - _M_insert_float(iter_type, ios_base& __io, char_type __fill, + _M_insert_float(iter_type, ios_base& __io, char_type __fill, char __mod, _ValueT __v) const; void @@ -2414,7 +2414,7 @@ namespace std template<typename _ValueT> iter_type - _M_insert_int(iter_type, ios_base& __io, char_type __fill, + _M_insert_int(iter_type, ios_base& __io, char_type __fill, _ValueT __v) const; void @@ -2423,11 +2423,11 @@ namespace std char_type* __cs, int& __len) const; void - _M_pad(char_type __fill, streamsize __w, ios_base& __io, + _M_pad(char_type __fill, streamsize __w, ios_base& __io, char_type* __new, const char_type* __cs, int& __len) const; /// Destructor. - virtual + virtual ~num_put() { }; //@{ @@ -2444,30 +2444,30 @@ namespace std * @param v Value to format and insert. * @return Iterator after writing. */ - virtual iter_type + virtual iter_type do_put(iter_type, ios_base&, char_type __fill, bool __v) const; - virtual iter_type + virtual iter_type do_put(iter_type, ios_base&, char_type __fill, long __v) const; - virtual iter_type + virtual iter_type do_put(iter_type, ios_base&, char_type __fill, unsigned long) const; -#ifdef _GLIBCXX_USE_LONG_LONG - virtual iter_type +#ifdef _GLIBCXX_USE_LONG_LONG + virtual iter_type do_put(iter_type, ios_base&, char_type __fill, long long __v) const; virtual iter_type do_put(iter_type, ios_base&, char_type __fill, unsigned long long) const; #endif - virtual iter_type + virtual iter_type do_put(iter_type, ios_base&, char_type __fill, double __v) const; - virtual iter_type + virtual iter_type do_put(iter_type, ios_base&, char_type __fill, long double __v) const; - virtual iter_type + virtual iter_type do_put(iter_type, ios_base&, char_type __fill, const void* __v) const; //@} }; @@ -2495,18 +2495,18 @@ namespace std // Types: //@{ /// Public typedefs - typedef _CharT char_type; - typedef basic_string<_CharT> string_type; + typedef _CharT char_type; + typedef basic_string<_CharT> string_type; //@} protected: // Underlying "C" library locale information saved from // initialization, needed by collate_byname as well. __c_locale _M_c_locale_collate; - + public: /// Numpunct facet id. - static locale::id id; + static locale::id id; /** * @brief Constructor performs initialization. @@ -2515,7 +2515,7 @@ namespace std * * @param refs Passed to the base facet class. */ - explicit + explicit collate(size_t __refs = 0) : facet(__refs) { _M_c_locale_collate = _S_get_c_locale(); } @@ -2529,8 +2529,8 @@ namespace std * @param cloc The "C" locale. * @param refs Passed to the base facet class. */ - explicit - collate(__c_locale __cloc, size_t __refs = 0) + explicit + collate(__c_locale __cloc, size_t __refs = 0) : facet(__refs) { _M_c_locale_collate = _S_clone_c_locale(__cloc); } @@ -2546,7 +2546,7 @@ namespace std * @param hi2 End of string 2. * @return 1 if string1 > string2, -1 if string1 < string2, else 0. */ - int + int compare(const _CharT* __lo1, const _CharT* __hi1, const _CharT* __lo2, const _CharT* __hi2) const { return this->do_compare(__lo1, __hi1, __lo2, __hi2); } @@ -2565,7 +2565,7 @@ namespace std * @param hi End of string. * @return Transformed string_type. */ - string_type + string_type transform(const _CharT* __lo, const _CharT* __hi) const { return this->do_transform(__lo, __hi); } @@ -2579,10 +2579,10 @@ namespace std * @param hi End of string. * @return Hash value. */ - long + long hash(const _CharT* __lo, const _CharT* __hi) const { return this->do_hash(__lo, __hi); } - + // Used to abstract out _CharT bits in virtual member functions, below. int _M_compare(const _CharT*, const _CharT*) const; @@ -2593,7 +2593,7 @@ namespace std protected: /// Destructor. virtual - ~collate() + ~collate() { _S_destroy_c_locale(_M_c_locale_collate); } /** @@ -2608,7 +2608,7 @@ namespace std * @param hi2 End of string 2. * @return 1 if string1 > string2, -1 if string1 < string2, else 0. */ - virtual int + virtual int do_compare(const _CharT* __lo1, const _CharT* __hi1, const _CharT* __lo2, const _CharT* __hi2) const; @@ -2624,7 +2624,7 @@ namespace std * @param hi2 End of string 2. * @return 1 if string1 > string2, -1 if string1 < string2, else 0. */ - virtual string_type + virtual string_type do_transform(const _CharT* __lo, const _CharT* __hi) const; /** @@ -2637,7 +2637,7 @@ namespace std * @param hi End of string. * @return Hash value. */ - virtual long + virtual long do_hash(const _CharT* __lo, const _CharT* __hi) const; }; @@ -2646,7 +2646,7 @@ namespace std // Specializations. template<> - int + int collate<char>::_M_compare(const char*, const char*) const; template<> @@ -2655,7 +2655,7 @@ namespace std #ifdef _GLIBCXX_USE_WCHAR_T template<> - int + int collate<wchar_t>::_M_compare(const wchar_t*, const wchar_t*) const; template<> @@ -2673,19 +2673,19 @@ namespace std typedef basic_string<_CharT> string_type; //@} - explicit + explicit collate_byname(const char* __s, size_t __refs = 0) - : collate<_CharT>(__refs) - { + : collate<_CharT>(__refs) + { if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) { this->_S_destroy_c_locale(this->_M_c_locale_collate); - this->_S_create_c_locale(this->_M_c_locale_collate, __s); + this->_S_create_c_locale(this->_M_c_locale_collate, __s); } } protected: - virtual + virtual ~collate_byname() { } }; @@ -2706,82 +2706,82 @@ namespace std struct __timepunct_cache : public locale::facet { // List of all known timezones, with GMT first. - static const _CharT* _S_timezones[14]; + static const _CharT* _S_timezones[14]; - const _CharT* _M_date_format; - const _CharT* _M_date_era_format; - const _CharT* _M_time_format; - const _CharT* _M_time_era_format; + const _CharT* _M_date_format; + const _CharT* _M_date_era_format; + const _CharT* _M_time_format; + const _CharT* _M_time_era_format; const _CharT* _M_date_time_format; const _CharT* _M_date_time_era_format; - const _CharT* _M_am; - const _CharT* _M_pm; + const _CharT* _M_am; + const _CharT* _M_pm; const _CharT* _M_am_pm_format; // Day names, starting with "C"'s Sunday. - const _CharT* _M_day1; - const _CharT* _M_day2; - const _CharT* _M_day3; - const _CharT* _M_day4; - const _CharT* _M_day5; - const _CharT* _M_day6; - const _CharT* _M_day7; + const _CharT* _M_day1; + const _CharT* _M_day2; + const _CharT* _M_day3; + const _CharT* _M_day4; + const _CharT* _M_day5; + const _CharT* _M_day6; + const _CharT* _M_day7; // Abbreviated day names, starting with "C"'s Sun. - const _CharT* _M_aday1; - const _CharT* _M_aday2; - const _CharT* _M_aday3; - const _CharT* _M_aday4; - const _CharT* _M_aday5; - const _CharT* _M_aday6; - const _CharT* _M_aday7; + const _CharT* _M_aday1; + const _CharT* _M_aday2; + const _CharT* _M_aday3; + const _CharT* _M_aday4; + const _CharT* _M_aday5; + const _CharT* _M_aday6; + const _CharT* _M_aday7; // Month names, starting with "C"'s January. - const _CharT* _M_month01; - const _CharT* _M_month02; - const _CharT* _M_month03; - const _CharT* _M_month04; - const _CharT* _M_month05; - const _CharT* _M_month06; - const _CharT* _M_month07; - const _CharT* _M_month08; - const _CharT* _M_month09; - const _CharT* _M_month10; - const _CharT* _M_month11; - const _CharT* _M_month12; + const _CharT* _M_month01; + const _CharT* _M_month02; + const _CharT* _M_month03; + const _CharT* _M_month04; + const _CharT* _M_month05; + const _CharT* _M_month06; + const _CharT* _M_month07; + const _CharT* _M_month08; + const _CharT* _M_month09; + const _CharT* _M_month10; + const _CharT* _M_month11; + const _CharT* _M_month12; // Abbreviated month names, starting with "C"'s Jan. - const _CharT* _M_amonth01; - const _CharT* _M_amonth02; - const _CharT* _M_amonth03; - const _CharT* _M_amonth04; - const _CharT* _M_amonth05; - const _CharT* _M_amonth06; - const _CharT* _M_amonth07; - const _CharT* _M_amonth08; - const _CharT* _M_amonth09; - const _CharT* _M_amonth10; - const _CharT* _M_amonth11; - const _CharT* _M_amonth12; + const _CharT* _M_amonth01; + const _CharT* _M_amonth02; + const _CharT* _M_amonth03; + const _CharT* _M_amonth04; + const _CharT* _M_amonth05; + const _CharT* _M_amonth06; + const _CharT* _M_amonth07; + const _CharT* _M_amonth08; + const _CharT* _M_amonth09; + const _CharT* _M_amonth10; + const _CharT* _M_amonth11; + const _CharT* _M_amonth12; bool _M_allocated; - __timepunct_cache(size_t __refs = 0) : facet(__refs), + __timepunct_cache(size_t __refs = 0) : facet(__refs), _M_date_format(NULL), _M_date_era_format(NULL), _M_time_format(NULL), - _M_time_era_format(NULL), _M_date_time_format(NULL), - _M_date_time_era_format(NULL), _M_am(NULL), _M_pm(NULL), - _M_am_pm_format(NULL), _M_day1(NULL), _M_day2(NULL), _M_day3(NULL), - _M_day4(NULL), _M_day5(NULL), _M_day6(NULL), _M_day7(NULL), - _M_aday1(NULL), _M_aday2(NULL), _M_aday3(NULL), _M_aday4(NULL), + _M_time_era_format(NULL), _M_date_time_format(NULL), + _M_date_time_era_format(NULL), _M_am(NULL), _M_pm(NULL), + _M_am_pm_format(NULL), _M_day1(NULL), _M_day2(NULL), _M_day3(NULL), + _M_day4(NULL), _M_day5(NULL), _M_day6(NULL), _M_day7(NULL), + _M_aday1(NULL), _M_aday2(NULL), _M_aday3(NULL), _M_aday4(NULL), _M_aday5(NULL), _M_aday6(NULL), _M_aday7(NULL), _M_month01(NULL), - _M_month02(NULL), _M_month03(NULL), _M_month04(NULL), _M_month05(NULL), - _M_month06(NULL), _M_month07(NULL), _M_month08(NULL), _M_month09(NULL), + _M_month02(NULL), _M_month03(NULL), _M_month04(NULL), _M_month05(NULL), + _M_month06(NULL), _M_month07(NULL), _M_month08(NULL), _M_month09(NULL), _M_month10(NULL), _M_month11(NULL), _M_month12(NULL), _M_amonth01(NULL), - _M_amonth02(NULL), _M_amonth03(NULL), _M_amonth04(NULL), - _M_amonth05(NULL), _M_amonth06(NULL), _M_amonth07(NULL), - _M_amonth08(NULL), _M_amonth09(NULL), _M_amonth10(NULL), + _M_amonth02(NULL), _M_amonth03(NULL), _M_amonth04(NULL), + _M_amonth05(NULL), _M_amonth06(NULL), _M_amonth07(NULL), + _M_amonth08(NULL), _M_amonth09(NULL), _M_amonth10(NULL), _M_amonth11(NULL), _M_amonth12(NULL), _M_allocated(false) - { } + { } ~__timepunct_cache(); @@ -2799,12 +2799,12 @@ namespace std } // Specializations. - template<> + template<> const char* __timepunct_cache<char>::_S_timezones[14]; #ifdef _GLIBCXX_USE_WCHAR_T - template<> + template<> const wchar_t* __timepunct_cache<wchar_t>::_S_timezones[14]; #endif @@ -2818,8 +2818,8 @@ namespace std { public: // Types: - typedef _CharT __char_type; - typedef basic_string<_CharT> __string_type; + typedef _CharT __char_type; + typedef basic_string<_CharT> __string_type; typedef __timepunct_cache<_CharT> __cache_type; protected: @@ -2829,12 +2829,12 @@ namespace std public: /// Numpunct facet id. - static locale::id id; + static locale::id id; - explicit + explicit __timepunct(size_t __refs = 0); - explicit + explicit __timepunct(__cache_type* __cache, size_t __refs = 0); /** @@ -2847,11 +2847,11 @@ namespace std * @param s The name of a locale. * @param refs Passed to the base facet class. */ - explicit + explicit __timepunct(__c_locale __cloc, const char* __s, size_t __refs = 0); void - _M_put(_CharT* __s, size_t __maxlen, const _CharT* __format, + _M_put(_CharT* __s, size_t __maxlen, const _CharT* __format, const tm* __tm) const; void @@ -2859,7 +2859,7 @@ namespace std { // Always have default first. __date[0] = _M_data->_M_date_format; - __date[1] = _M_data->_M_date_era_format; + __date[1] = _M_data->_M_date_era_format; } void @@ -2867,27 +2867,27 @@ namespace std { // Always have default first. __time[0] = _M_data->_M_time_format; - __time[1] = _M_data->_M_time_era_format; + __time[1] = _M_data->_M_time_era_format; } void _M_ampm(const _CharT** __ampm) const - { + { __ampm[0] = _M_data->_M_am; __ampm[1] = _M_data->_M_pm; - } + } void _M_date_time_formats(const _CharT** __dt) const { // Always have default first. __dt[0] = _M_data->_M_date_time_format; - __dt[1] = _M_data->_M_date_time_era_format; + __dt[1] = _M_data->_M_date_time_era_format; } void _M_days(const _CharT** __days) const - { + { __days[0] = _M_data->_M_day1; __days[1] = _M_data->_M_day2; __days[2] = _M_data->_M_day3; @@ -2899,7 +2899,7 @@ namespace std void _M_days_abbreviated(const _CharT** __days) const - { + { __days[0] = _M_data->_M_aday1; __days[1] = _M_data->_M_aday2; __days[2] = _M_data->_M_aday3; @@ -2911,7 +2911,7 @@ namespace std void _M_months(const _CharT** __months) const - { + { __months[0] = _M_data->_M_month01; __months[1] = _M_data->_M_month02; __months[2] = _M_data->_M_month03; @@ -2928,7 +2928,7 @@ namespace std void _M_months_abbreviated(const _CharT** __months) const - { + { __months[0] = _M_data->_M_amonth01; __months[1] = _M_data->_M_amonth02; __months[2] = _M_data->_M_amonth03; @@ -2944,11 +2944,11 @@ namespace std } protected: - virtual + virtual ~__timepunct(); // For use at construction time only. - void + void _M_initialize_timepunct(__c_locale __cloc = NULL); }; @@ -2956,7 +2956,7 @@ namespace std locale::id __timepunct<_CharT>::id; // Specializations. - template<> + template<> void __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc); @@ -2965,13 +2965,13 @@ namespace std __timepunct<char>::_M_put(char*, size_t, const char*, const tm*) const; #ifdef _GLIBCXX_USE_WCHAR_T - template<> + template<> void __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc); template<> void - __timepunct<wchar_t>::_M_put(wchar_t*, size_t, const wchar_t*, + __timepunct<wchar_t>::_M_put(wchar_t*, size_t, const wchar_t*, const tm*) const; #endif @@ -2997,13 +2997,13 @@ namespace std // Types: //@{ /// Public typedefs - typedef _CharT char_type; - typedef _InIter iter_type; + typedef _CharT char_type; + typedef _InIter iter_type; //@} - typedef basic_string<_CharT> __string_type; + typedef basic_string<_CharT> __string_type; /// Numpunct facet id. - static locale::id id; + static locale::id id; /** * @brief Constructor performs initialization. @@ -3012,8 +3012,8 @@ namespace std * * @param refs Passed to the base facet class. */ - explicit - time_get(size_t __refs = 0) + explicit + time_get(size_t __refs = 0) : facet (__refs) { } /** @@ -3023,13 +3023,13 @@ namespace std * preferred ordering if the format "x" given to time_put::put() only * uses month, day, and year. If the format "x" for the associated * locale uses other fields, this function returns - * timebase::dateorder::noorder. + * timebase::dateorder::noorder. * * NOTE: The library always returns noorder at the moment. * * @return A member of timebase::dateorder. */ - dateorder + dateorder date_order() const { return this->do_date_order(); } @@ -3053,8 +3053,8 @@ namespace std * @param tm Pointer to struct tm to fill in. * @return Iterator to first char beyond time string. */ - iter_type - get_time(iter_type __beg, iter_type __end, ios_base& __io, + iter_type + get_time(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm) const { return this->do_get_time(__beg, __end, __io, __err, __tm); } @@ -3078,7 +3078,7 @@ namespace std * @param tm Pointer to struct tm to fill in. * @return Iterator to first char beyond date string. */ - iter_type + iter_type get_date(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm) const { return this->do_get_date(__beg, __end, __io, __err, __tm); } @@ -3106,7 +3106,7 @@ namespace std * @param tm Pointer to struct tm to fill in. * @return Iterator to first char beyond weekday name. */ - iter_type + iter_type get_weekday(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm) const { return this->do_get_weekday(__beg, __end, __io, __err, __tm); } @@ -3135,8 +3135,8 @@ namespace std * @param tm Pointer to struct tm to fill in. * @return Iterator to first char beyond month name. */ - iter_type - get_monthname(iter_type __beg, iter_type __end, ios_base& __io, + iter_type + get_monthname(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm) const { return this->do_get_monthname(__beg, __end, __io, __err, __tm); } @@ -3161,14 +3161,14 @@ namespace std * @param tm Pointer to struct tm to fill in. * @return Iterator to first char beyond year. */ - iter_type + iter_type get_year(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm) const { return this->do_get_year(__beg, __end, __io, __err, __tm); } protected: /// Destructor. - virtual + virtual ~time_get() { } /** @@ -3181,7 +3181,7 @@ namespace std * * @return A member of timebase::dateorder. */ - virtual dateorder + virtual dateorder do_date_order() const; /** @@ -3199,7 +3199,7 @@ namespace std * @param tm Pointer to struct tm to fill in. * @return Iterator to first char beyond time string. */ - virtual iter_type + virtual iter_type do_get_time(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm) const; @@ -3218,7 +3218,7 @@ namespace std * @param tm Pointer to struct tm to fill in. * @return Iterator to first char beyond date string. */ - virtual iter_type + virtual iter_type do_get_date(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm) const; @@ -3237,7 +3237,7 @@ namespace std * @param tm Pointer to struct tm to fill in. * @return Iterator to first char beyond weekday name. */ - virtual iter_type + virtual iter_type do_get_weekday(iter_type __beg, iter_type __end, ios_base&, ios_base::iostate& __err, tm* __tm) const; @@ -3256,8 +3256,8 @@ namespace std * @param tm Pointer to struct tm to fill in. * @return Iterator to first char beyond month name. */ - virtual iter_type - do_get_monthname(iter_type __beg, iter_type __end, ios_base&, + virtual iter_type + do_get_monthname(iter_type __beg, iter_type __end, ios_base&, ios_base::iostate& __err, tm* __tm) const; /** @@ -3275,7 +3275,7 @@ namespace std * @param tm Pointer to struct tm to fill in. * @return Iterator to first char beyond year. */ - virtual iter_type + virtual iter_type do_get_year(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm) const; @@ -3283,21 +3283,21 @@ namespace std void _M_extract_num(iter_type& __beg, iter_type& __end, int& __member, int __min, int __max, size_t __len, - const ctype<_CharT>& __ctype, + const ctype<_CharT>& __ctype, ios_base::iostate& __err) const; - + // Extract day or month name, or any unique array of string // literals in a const _CharT* array. void _M_extract_name(iter_type& __beg, iter_type& __end, int& __member, - const _CharT** __names, size_t __indexlen, - const ctype<_CharT>& __ctype, + const _CharT** __names, size_t __indexlen, + const ctype<_CharT>& __ctype, ios_base::iostate& __err) const; // Extract on a component-by-component basis, via __format argument. void _M_extract_via_format(iter_type& __beg, iter_type& __end, ios_base& __io, - ios_base::iostate& __err, tm* __tm, + ios_base::iostate& __err, tm* __tm, const _CharT* __format) const; }; @@ -3309,15 +3309,15 @@ namespace std { public: // Types: - typedef _CharT char_type; - typedef _InIter iter_type; + typedef _CharT char_type; + typedef _InIter iter_type; - explicit - time_get_byname(const char*, size_t __refs = 0) + explicit + time_get_byname(const char*, size_t __refs = 0) : time_get<_CharT, _InIter>(__refs) { } protected: - virtual + virtual ~time_get_byname() { } }; @@ -3339,12 +3339,12 @@ namespace std // Types: //@{ /// Public typedefs - typedef _CharT char_type; - typedef _OutIter iter_type; + typedef _CharT char_type; + typedef _OutIter iter_type; //@} /// Numpunct facet id. - static locale::id id; + static locale::id id; /** * @brief Constructor performs initialization. @@ -3353,8 +3353,8 @@ namespace std * * @param refs Passed to the base facet class. */ - explicit - time_put(size_t __refs = 0) + explicit + time_put(size_t __refs = 0) : facet(__refs) { } /** @@ -3372,8 +3372,8 @@ namespace std * @param end End of format string. * @return Iterator after writing. */ - iter_type - put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm, + iter_type + put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm, const _CharT* __beg, const _CharT* __end) const; /** @@ -3392,14 +3392,14 @@ namespace std * @param mod Optional modifier char. * @return Iterator after writing. */ - iter_type + iter_type put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm, char __format, char __mod = 0) const { return this->do_put(__s, __io, __fill, __tm, __format, __mod); } protected: /// Destructor. - virtual + virtual ~time_put() { } @@ -3419,8 +3419,8 @@ namespace std * @param mod Optional modifier char. * @return Iterator after writing. */ - virtual iter_type - do_put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm, + virtual iter_type + do_put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm, char __format, char __mod) const; }; @@ -3432,16 +3432,16 @@ namespace std { public: // Types: - typedef _CharT char_type; - typedef _OutIter iter_type; + typedef _CharT char_type; + typedef _OutIter iter_type; - explicit - time_put_byname(const char*, size_t __refs = 0) - : time_put<_CharT, _OutIter>(__refs) + explicit + time_put_byname(const char*, size_t __refs = 0) + : time_put<_CharT, _OutIter>(__refs) { }; protected: - virtual + virtual ~time_put_byname() { } }; @@ -3466,33 +3466,33 @@ namespace std // Construct and return valid pattern consisting of some combination of: // space none symbol sign value - static pattern + static pattern _S_construct_pattern(char __precedes, char __space, char __posn); }; template<typename _CharT> struct __moneypunct_cache : public locale::facet { - const char* _M_grouping; + const char* _M_grouping; bool _M_use_grouping; - _CharT _M_decimal_point; - _CharT _M_thousands_sep; - const _CharT* _M_curr_symbol; + _CharT _M_decimal_point; + _CharT _M_thousands_sep; + const _CharT* _M_curr_symbol; const _CharT* _M_positive_sign; const _CharT* _M_negative_sign; - int _M_frac_digits; - money_base::pattern _M_pos_format; - money_base::pattern _M_neg_format; + int _M_frac_digits; + money_base::pattern _M_pos_format; + money_base::pattern _M_neg_format; bool _M_allocated; - __moneypunct_cache(size_t __refs = 0) : facet(__refs), - _M_grouping(NULL), _M_use_grouping(false), _M_decimal_point(_CharT()), + __moneypunct_cache(size_t __refs = 0) : facet(__refs), + _M_grouping(NULL), _M_use_grouping(false), _M_decimal_point(_CharT()), _M_thousands_sep(_CharT()), _M_curr_symbol(NULL), _M_positive_sign(NULL), - _M_negative_sign(NULL), _M_frac_digits(0), - _M_pos_format(money_base::pattern()), + _M_negative_sign(NULL), _M_frac_digits(0), + _M_pos_format(money_base::pattern()), _M_neg_format(money_base::pattern()), _M_allocated(false) - { } + { } ~__moneypunct_cache(); @@ -3522,8 +3522,8 @@ namespace std // Types: //@{ /// Public typedefs - typedef _CharT char_type; - typedef basic_string<_CharT> string_type; + typedef _CharT char_type; + typedef basic_string<_CharT> string_type; //@} typedef __moneypunct_cache<_CharT> __cache_type; @@ -3533,9 +3533,9 @@ namespace std public: /// This value is provided by the standard, but no reason for its /// existence. - static const bool intl = _Intl; + static const bool intl = _Intl; /// Numpunct facet id. - static locale::id id; + static locale::id id; /** * @brief Constructor performs initialization. @@ -3544,7 +3544,7 @@ namespace std * * @param refs Passed to the base facet class. */ - explicit + explicit moneypunct(size_t __refs = 0) : facet(__refs), _M_data(NULL) { _M_initialize_moneypunct(); } @@ -3556,8 +3556,8 @@ namespace std * @param cache Cache for optimization. * @param refs Passed to the base facet class. */ - explicit - moneypunct(__cache_type* __cache, size_t __refs = 0) + explicit + moneypunct(__cache_type* __cache, size_t __refs = 0) : facet(__refs), _M_data(__cache) { _M_initialize_moneypunct(); } @@ -3571,8 +3571,8 @@ namespace std * @param s The name of a locale. * @param refs Passed to the base facet class. */ - explicit - moneypunct(__c_locale __cloc, const char* __s, size_t __refs = 0) + explicit + moneypunct(__c_locale __cloc, const char* __s, size_t __refs = 0) : facet(__refs), _M_data(NULL) { _M_initialize_moneypunct(__cloc, __s); } @@ -3588,7 +3588,7 @@ namespace std char_type decimal_point() const { return this->do_decimal_point(); } - + /** * @brief Return thousands separator character. * @@ -3601,7 +3601,7 @@ namespace std char_type thousands_sep() const { return this->do_thousands_sep(); } - + /** * @brief Return grouping specification. * @@ -3627,7 +3627,7 @@ namespace std * * @return string representing grouping specification. */ - string + string grouping() const { return this->do_grouping(); } @@ -3640,7 +3640,7 @@ namespace std * * @return @a string_type representing a currency symbol. */ - string_type + string_type curr_symbol() const { return this->do_curr_symbol(); } @@ -3657,7 +3657,7 @@ namespace std * * @return @a string_type representing a positive sign. */ - string_type + string_type positive_sign() const { return this->do_positive_sign(); } @@ -3674,7 +3674,7 @@ namespace std * * @return @a string_type representing a negative sign. */ - string_type + string_type negative_sign() const { return this->do_negative_sign(); } @@ -3729,14 +3729,14 @@ namespace std pos_format() const { return this->do_pos_format(); } - pattern + pattern neg_format() const { return this->do_neg_format(); } //@} protected: /// Destructor. - virtual + virtual ~moneypunct(); /** @@ -3750,7 +3750,7 @@ namespace std virtual char_type do_decimal_point() const { return _M_data->_M_decimal_point; } - + /** * @brief Return thousands separator character. * @@ -3762,7 +3762,7 @@ namespace std virtual char_type do_thousands_sep() const { return _M_data->_M_thousands_sep; } - + /** * @brief Return grouping specification. * @@ -3772,7 +3772,7 @@ namespace std * * @return String representing grouping specification. */ - virtual string + virtual string do_grouping() const { return _M_data->_M_grouping; } @@ -3785,7 +3785,7 @@ namespace std * * @return @a string_type representing a currency symbol. */ - virtual string_type + virtual string_type do_curr_symbol() const { return _M_data->_M_curr_symbol; } @@ -3798,7 +3798,7 @@ namespace std * * @return @a string_type representing a positive sign. */ - virtual string_type + virtual string_type do_positive_sign() const { return _M_data->_M_positive_sign; } @@ -3811,7 +3811,7 @@ namespace std * * @return @a string_type representing a negative sign. */ - virtual string_type + virtual string_type do_negative_sign() const { return _M_data->_M_negative_sign; } @@ -3825,7 +3825,7 @@ namespace std * * @return Number of digits in amount fraction. */ - virtual int + virtual int do_frac_digits() const { return _M_data->_M_frac_digits; } @@ -3839,7 +3839,7 @@ namespace std * * @return Pattern for money values. */ - virtual pattern + virtual pattern do_pos_format() const { return _M_data->_M_pos_format; } @@ -3853,13 +3853,13 @@ namespace std * * @return Pattern for money values. */ - virtual pattern + virtual pattern do_neg_format() const { return _M_data->_M_neg_format; } // For use at construction time only. - void - _M_initialize_moneypunct(__c_locale __cloc = NULL, + void + _M_initialize_moneypunct(__c_locale __cloc = NULL, const char* __name = NULL); }; @@ -3875,11 +3875,11 @@ namespace std template<> moneypunct<char, false>::~moneypunct(); - template<> + template<> void moneypunct<char, true>::_M_initialize_moneypunct(__c_locale, const char*); - template<> + template<> void moneypunct<char, false>::_M_initialize_moneypunct(__c_locale, const char*); @@ -3890,14 +3890,14 @@ namespace std template<> moneypunct<wchar_t, false>::~moneypunct(); - template<> + template<> void - moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale, + moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale, const char*); - template<> + template<> void - moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale, + moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale, const char*); #endif @@ -3905,12 +3905,12 @@ namespace std class moneypunct_byname : public moneypunct<_CharT, _Intl> { public: - typedef _CharT char_type; - typedef basic_string<_CharT> string_type; + typedef _CharT char_type; + typedef basic_string<_CharT> string_type; static const bool intl = _Intl; - explicit + explicit moneypunct_byname(const char* __s, size_t __refs = 0) : moneypunct<_CharT, _Intl>(__refs) { @@ -3918,13 +3918,13 @@ namespace std { __c_locale __tmp; this->_S_create_c_locale(__tmp, __s); - this->_M_initialize_moneypunct(__tmp); - this->_S_destroy_c_locale(__tmp); + this->_M_initialize_moneypunct(__tmp); + this->_S_destroy_c_locale(__tmp); } } protected: - virtual + virtual ~moneypunct_byname() { } }; @@ -3950,13 +3950,13 @@ namespace std // Types: //@{ /// Public typedefs - typedef _CharT char_type; - typedef _InIter iter_type; - typedef basic_string<_CharT> string_type; + typedef _CharT char_type; + typedef _InIter iter_type; + typedef basic_string<_CharT> string_type; //@} /// Numpunct facet id. - static locale::id id; + static locale::id id; /** * @brief Constructor performs initialization. @@ -3965,7 +3965,7 @@ namespace std * * @param refs Passed to the base facet class. */ - explicit + explicit money_get(size_t __refs = 0) : facet(__refs) { } /** @@ -3993,10 +3993,10 @@ namespace std * @param err Error field to set if parsing fails. * @param units Place to store result of parsing. * @return Iterator referencing first character beyond valid money - * amount. + * amount. */ iter_type - get(iter_type __s, iter_type __end, bool __intl, ios_base& __io, + get(iter_type __s, iter_type __end, bool __intl, ios_base& __io, ios_base::iostate& __err, long double& __units) const { return this->do_get(__s, __end, __intl, __io, __err, __units); } @@ -4023,16 +4023,16 @@ namespace std * @param err Error field to set if parsing fails. * @param digits Place to store result of parsing. * @return Iterator referencing first character beyond valid money - * amount. + * amount. */ - iter_type - get(iter_type __s, iter_type __end, bool __intl, ios_base& __io, + iter_type + get(iter_type __s, iter_type __end, bool __intl, ios_base& __io, ios_base::iostate& __err, string_type& __digits) const { return this->do_get(__s, __end, __intl, __io, __err, __digits); } protected: /// Destructor. - virtual + virtual ~money_get() { } /** @@ -4042,8 +4042,8 @@ namespace std * value. This function is a hook for derived classes to change the * value returned. @see get() for details. */ - virtual iter_type - do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io, + virtual iter_type + do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io, ios_base::iostate& __err, long double& __units) const; /** @@ -4053,8 +4053,8 @@ namespace std * value. This function is a hook for derived classes to change the * value returned. @see get() for details. */ - virtual iter_type - do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io, + virtual iter_type + do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io, ios_base::iostate& __err, string_type& __digits) const; }; @@ -4079,13 +4079,13 @@ namespace std public: //@{ /// Public typedefs - typedef _CharT char_type; - typedef _OutIter iter_type; + typedef _CharT char_type; + typedef _OutIter iter_type; typedef basic_string<_CharT> string_type; //@} /// Numpunct facet id. - static locale::id id; + static locale::id id; /** * @brief Constructor performs initialization. @@ -4094,7 +4094,7 @@ namespace std * * @param refs Passed to the base facet class. */ - explicit + explicit money_put(size_t __refs = 0) : facet(__refs) { } /** @@ -4114,7 +4114,7 @@ namespace std * @param units Place to store result of parsing. * @return Iterator after writing. */ - iter_type + iter_type put(iter_type __s, bool __intl, ios_base& __io, char_type __fill, long double __units) const { return this->do_put(__s, __intl, __io, __fill, __units); } @@ -4136,14 +4136,14 @@ namespace std * @param units Place to store result of parsing. * @return Iterator after writing. */ - iter_type + iter_type put(iter_type __s, bool __intl, ios_base& __io, char_type __fill, const string_type& __digits) const { return this->do_put(__s, __intl, __io, __fill, __digits); } protected: /// Destructor. - virtual + virtual ~money_put() { } /** @@ -4229,8 +4229,8 @@ namespace std // Types: //@{ /// Public typedefs - typedef _CharT char_type; - typedef basic_string<_CharT> string_type; + typedef _CharT char_type; + typedef basic_string<_CharT> string_type; //@} protected: @@ -4241,7 +4241,7 @@ namespace std public: /// Numpunct facet id. - static locale::id id; + static locale::id id; /** * @brief Constructor performs initialization. @@ -4250,7 +4250,7 @@ namespace std * * @param refs Passed to the base facet class. */ - explicit + explicit messages(size_t __refs = 0); // Non-standard. @@ -4264,7 +4264,7 @@ namespace std * @param s The name of a locale. * @param refs Refcount to pass to the base class. */ - explicit + explicit messages(__c_locale __cloc, const char* __s, size_t __refs = 0); /* @@ -4277,7 +4277,7 @@ namespace std * @param loc Locale to use for character set conversions. * @return Handle to the catalog or value < 0 if open fails. */ - catalog + catalog open(const basic_string<char>& __s, const locale& __loc) const { return this->do_open(__s, __loc); } @@ -4295,7 +4295,7 @@ namespace std * @param dir Message catalog root directory. * @return Handle to the catalog or value < 0 if open fails. */ - catalog + catalog open(const basic_string<char>&, const locale&, const char*) const; /* @@ -4313,7 +4313,7 @@ namespace std * @param s Default return value if retrieval fails. * @return Retrieved message or @a s if get fails. */ - string_type + string_type get(catalog __c, int __set, int __msgid, const string_type& __s) const { return this->do_get(__c, __set, __msgid, __s); } @@ -4324,13 +4324,13 @@ namespace std * * @param c The catalog to close. */ - void + void close(catalog __c) const { return this->do_close(__c); } protected: /// Destructor. - virtual + virtual ~messages(); /* @@ -4344,7 +4344,7 @@ namespace std * @param loc Locale to use for character set conversions. * @return Handle to the opened catalog, value < 0 if open failed. */ - virtual catalog + virtual catalog do_open(const basic_string<char>&, const locale&) const; /* @@ -4363,7 +4363,7 @@ namespace std * @param s Default return value if retrieval fails. * @return Retrieved message or @a s if get fails. */ - virtual string_type + virtual string_type do_get(catalog, int, int, const string_type& __dfault) const; /* @@ -4371,7 +4371,7 @@ namespace std * * @param c The catalog to close. */ - virtual void + virtual void do_close(catalog) const; // Returns a locale and codeset-converted string, given a char* message. @@ -4396,12 +4396,12 @@ namespace std // Convert char* to _CharT in locale used to open catalog. // XXX need additional template parameter on messages class for this.. // typedef typename codecvt<char, _CharT, _StateT> __codecvt_type; - typedef typename codecvt<char, _CharT, mbstate_t> __codecvt_type; + typedef typename codecvt<char, _CharT, mbstate_t> __codecvt_type; __codecvt_type::state_type __state; // XXX may need to initialize state. //initialize_state(__state._M_init()); - + char* __from_next; // XXX what size for this string? _CharT* __to = static_cast<_CharT*>(__builtin_alloca(__len + 1)); @@ -4442,15 +4442,15 @@ namespace std class messages_byname : public messages<_CharT> { public: - typedef _CharT char_type; - typedef basic_string<_CharT> string_type; + typedef _CharT char_type; + typedef basic_string<_CharT> string_type; - explicit + explicit messages_byname(const char* __s, size_t __refs = 0); protected: - virtual - ~messages_byname() + virtual + ~messages_byname() { } }; @@ -4465,22 +4465,22 @@ namespace std //@{ /// Convenience interface to ctype.is(). template<typename _CharT> - inline bool + inline bool isspace(_CharT __c, const locale& __loc) { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::space, __c); } template<typename _CharT> - inline bool + inline bool isprint(_CharT __c, const locale& __loc) { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::print, __c); } template<typename _CharT> - inline bool + inline bool iscntrl(_CharT __c, const locale& __loc) { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::cntrl, __c); } template<typename _CharT> - inline bool + inline bool isupper(_CharT __c, const locale& __loc) { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::upper, __c); } @@ -4489,42 +4489,42 @@ namespace std { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::lower, __c); } template<typename _CharT> - inline bool + inline bool isalpha(_CharT __c, const locale& __loc) { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alpha, __c); } template<typename _CharT> - inline bool + inline bool isdigit(_CharT __c, const locale& __loc) { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::digit, __c); } template<typename _CharT> - inline bool + inline bool ispunct(_CharT __c, const locale& __loc) { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::punct, __c); } template<typename _CharT> - inline bool + inline bool isxdigit(_CharT __c, const locale& __loc) { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::xdigit, __c); } template<typename _CharT> - inline bool + inline bool isalnum(_CharT __c, const locale& __loc) { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alnum, __c); } template<typename _CharT> - inline bool + inline bool isgraph(_CharT __c, const locale& __loc) { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::graph, __c); } template<typename _CharT> - inline _CharT + inline _CharT toupper(_CharT __c, const locale& __loc) { return use_facet<ctype<_CharT> >(__loc).toupper(__c); } template<typename _CharT> - inline _CharT + inline _CharT tolower(_CharT __c, const locale& __loc) { return use_facet<ctype<_CharT> >(__loc).tolower(__c); } //@} diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc index 2a3a987ecd1..1b7e8e63ddc 100644 --- a/libstdc++-v3/include/bits/locale_facets.tcc +++ b/libstdc++-v3/include/bits/locale_facets.tcc @@ -35,8 +35,8 @@ #pragma GCC system_header -#include <limits> // For numeric_limits -#include <typeinfo> // For bad_cast. +#include <limits> // For numeric_limits +#include <typeinfo> // For bad_cast. #include <bits/streambuf_iterator.h> namespace std @@ -169,7 +169,7 @@ namespace std ios_base::iostate& __err, string& __xtrc) const { typedef char_traits<_CharT> __traits_type; - typedef typename numpunct<_CharT>::__cache_type __cache_type; + typedef typename numpunct<_CharT>::__cache_type __cache_type; __use_cache<__cache_type> __uc; const locale& __loc = __io._M_getloc(); const __cache_type* __lc = __uc(__loc); @@ -193,13 +193,13 @@ namespace std ++__beg; } } - + // Next, look for leading zeros. while (__beg != __end) { const char_type __c = *__beg; if (__traits_type::eq(__c, __lc->_M_decimal_point) - || (__lc->_M_use_grouping + || (__lc->_M_use_grouping && __traits_type::eq(__c, __lc->_M_thousands_sep))) break; else if (__traits_type::eq(__c, __lit[_S_izero])) @@ -272,8 +272,8 @@ namespace std ++__sep_pos; ++__beg; } - else if ((__e = __traits_type::eq(__c, __lit[_S_ie]) - || __traits_type::eq(__c, __lit[_S_iE])) + else if ((__e = __traits_type::eq(__c, __lit[_S_ie]) + || __traits_type::eq(__c, __lit[_S_iE])) && __found_mantissa && !__found_sci) { // Scientific notation. @@ -286,7 +286,7 @@ namespace std const bool __plus = __traits_type::eq(*__beg, __lit[_S_iplus]); if (__plus || __traits_type::eq(*__beg, __lit[_S_iminus])) { - __xtrc += __plus ? _S_atoms_in[_S_iplus] + __xtrc += __plus ? _S_atoms_in[_S_iplus] : _S_atoms_in[_S_iminus]; ++__beg; } @@ -318,14 +318,14 @@ namespace std } template<typename _CharT, typename _InIter> - template<typename _ValueT> + template<typename _ValueT> _InIter num_get<_CharT, _InIter>:: _M_extract_int(_InIter __beg, _InIter __end, ios_base& __io, ios_base::iostate& __err, _ValueT& __v) const { typedef char_traits<_CharT> __traits_type; - typedef typename numpunct<_CharT>::__cache_type __cache_type; + typedef typename numpunct<_CharT>::__cache_type __cache_type; __use_cache<__cache_type> __uc; const locale& __loc = __io._M_getloc(); const __cache_type* __lc = __uc(__loc); @@ -342,7 +342,7 @@ namespace std // First check for sign. bool __negative = false; if (__beg != __end) - { + { const char_type __c = *__beg; if (numeric_limits<_ValueT>::is_signed) __negative = __traits_type::eq(__c, __lit[_S_iminus]); @@ -466,7 +466,7 @@ namespace std __err |= ios_base::failbit; break; } - } + } else if (__traits_type::eq(__c, __lc->_M_decimal_point)) break; else if (__p = __traits_type::find(__lit_zero, __len, __c)) @@ -496,7 +496,7 @@ namespace std { // Add the ending grouping. __found_grouping += static_cast<char>(__sep_pos); - + if (!std::__verify_grouping(__lc->_M_grouping, __lc->_M_grouping_size, __found_grouping)) __err |= ios_base::failbit; @@ -560,7 +560,7 @@ namespace std break; if (!__testf && !__testt) - break; + break; } if (__testf && __n == __lc->_M_falsename_size) __v = 0; @@ -587,7 +587,7 @@ namespace std num_get<_CharT, _InIter>:: do_get(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, unsigned short& __v) const - { return _M_extract_int(__beg, __end, __io, __err, __v); } + { return _M_extract_int(__beg, __end, __io, __err, __v); } template<typename _CharT, typename _InIter> _InIter @@ -622,7 +622,7 @@ namespace std template<typename _CharT, typename _InIter> _InIter num_get<_CharT, _InIter>:: - do_get(iter_type __beg, iter_type __end, ios_base& __io, + do_get(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, float& __v) const { string __xtrc; @@ -677,7 +677,7 @@ namespace std if (!(__err & ios_base::failbit)) __v = reinterpret_cast<void*>(__ul); - else + else __err |= ios_base::failbit; return __beg; } @@ -687,12 +687,12 @@ namespace std template<typename _CharT, typename _OutIter> void num_put<_CharT, _OutIter>:: - _M_pad(_CharT __fill, streamsize __w, ios_base& __io, + _M_pad(_CharT __fill, streamsize __w, ios_base& __io, _CharT* __new, const _CharT* __cs, int& __len) const { // [22.2.2.2.2] Stage 3. // If necessary, pad. - __pad<_CharT, char_traits<_CharT> >::_S_pad(__io, __fill, __new, __cs, + __pad<_CharT, char_traits<_CharT> >::_S_pad(__io, __fill, __new, __cs, __w, __len, true); __len = static_cast<int>(__w); } @@ -705,12 +705,12 @@ namespace std { unsigned long __ul = static_cast<unsigned long>(__v); bool __neg = false; - if (__v < 0) + if (__v < 0) { __ul = -__ul; __neg = true; } - return __int_to_char(__bufend, __ul, __lit, __flags, __neg); + return __int_to_char(__bufend, __ul, __lit, __flags, __neg); } template<typename _CharT> @@ -724,15 +724,15 @@ namespace std inline int __int_to_char(_CharT* __bufend, long long __v, const _CharT* __lit, ios_base::fmtflags __flags) - { + { unsigned long long __ull = static_cast<unsigned long long>(__v); bool __neg = false; - if (__v < 0) + if (__v < 0) { __ull = -__ull; __neg = true; } - return __int_to_char(__bufend, __ull, __lit, __flags, __neg); + return __int_to_char(__bufend, __ull, __lit, __flags, __neg); } template<typename _CharT> @@ -741,7 +741,7 @@ namespace std ios_base::fmtflags __flags) { return __int_to_char(__bufend, __v, __lit, __flags, false); } #endif - + template<typename _CharT, typename _ValueT> int __int_to_char(_CharT* __bufend, _ValueT __v, const _CharT* __lit, @@ -756,11 +756,11 @@ namespace std __basefield != ios_base::hex, true)) { // Decimal. - do + do { *__buf-- = __lit[(__v % 10) + __num_base::_S_odigits]; __v /= 10; - } + } while (__v != 0); if (__neg) *__buf-- = __lit[__num_base::_S_ominus]; @@ -770,11 +770,11 @@ namespace std else if (__basefield == ios_base::oct) { // Octal. - do + do { *__buf-- = __lit[(__v & 0x7) + __num_base::_S_odigits]; __v >>= 3; - } + } while (__v != 0); if (__showbase) *__buf-- = __lit[__num_base::_S_odigits]; @@ -783,13 +783,13 @@ namespace std { // Hex. const bool __uppercase = __flags & ios_base::uppercase; - const int __case_offset = __uppercase ? __num_base::_S_oudigits + const int __case_offset = __uppercase ? __num_base::_S_oudigits : __num_base::_S_odigits; - do + do { *__buf-- = __lit[(__v & 0xf) + __case_offset]; __v >>= 4; - } + } while (__v != 0); if (__showbase) { @@ -814,7 +814,7 @@ namespace std // However, remember that the latter do not occur if the number // printed is '0' (__len == 1). streamsize __off = 0; - const ios_base::fmtflags __basefield = __io.flags() + const ios_base::fmtflags __basefield = __io.flags() & ios_base::basefield; if ((__io.flags() & ios_base::showbase) && __len > 1) if (__basefield == ios_base::oct) @@ -839,7 +839,7 @@ namespace std template<typename _ValueT> _OutIter num_put<_CharT, _OutIter>:: - _M_insert_int(_OutIter __s, ios_base& __io, _CharT __fill, + _M_insert_int(_OutIter __s, ios_base& __io, _CharT __fill, _ValueT __v) const { typedef typename numpunct<_CharT>::__cache_type __cache_type; @@ -848,9 +848,9 @@ namespace std const __cache_type* __lc = __uc(__loc); const _CharT* __lit = __lc->_M_atoms_out; - // Long enough to hold hex, dec, and octal representations. + // Long enough to hold hex, dec, and octal representations. const int __ilen = 4 * sizeof(_ValueT); - _CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) + _CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __ilen)); // [22.2.2.2.2] Stage 1, numeric conversion to character. @@ -858,24 +858,24 @@ namespace std int __len; __len = __int_to_char(__cs + __ilen, __v, __lit, __io.flags()); __cs += __ilen - __len; - - // Add grouping, if necessary. + + // Add grouping, if necessary. if (__lc->_M_use_grouping) { // Grouping can add (almost) as many separators as the // number of digits, but no more. - _CharT* __cs2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) + _CharT* __cs2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __len * 2)); _M_group_int(__lc->_M_grouping, __lc->_M_grouping_size, __lc->_M_thousands_sep, __io, __cs2, __cs, __len); __cs = __cs2; } - + // Pad. const streamsize __w = __io.width(); if (__w > static_cast<streamsize>(__len)) { - _CharT* __cs3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) + _CharT* __cs3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __w)); _M_pad(__fill, __w, __io, __cs3, __cs, __len); __cs = __cs3; @@ -885,7 +885,7 @@ namespace std // [22.2.2.2.2] Stage 4. // Write resulting, fully-formatted string to output iterator. return std::__write(__s, __cs, __len); - } + } template<typename _CharT, typename _OutIter> void @@ -895,19 +895,19 @@ namespace std { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 282. What types does numpunct grouping refer to? - // Add grouping, if necessary. + // Add grouping, if necessary. _CharT* __p2; const int __declen = __p ? __p - __cs : __len; __p2 = std::__add_grouping(__new, __sep, __grouping, __grouping_size, __cs, __cs + __declen); - + // Tack on decimal part. int __newlen = __p2 - __new; if (__p) { char_traits<_CharT>::copy(__p2, __p, __len - __declen); __newlen += __len - __declen; - } + } __len = __newlen; } @@ -967,7 +967,7 @@ namespace std // If the buffer was not large enough, try again with the correct size. if (__len >= __cs_size) { - __cs_size = __len + 1; + __cs_size = __len + 1; __cs = static_cast<char*>(__builtin_alloca(__cs_size)); __len = std::__convert_from_v(__cs, __cs_size, __fbuf, __v, _S_get_c_locale(), __prec); @@ -983,12 +983,12 @@ namespace std // fractional part + 3 chars for sign, decimal point, '\0'. On // the other hand, for non-fixed outputs __max_digits*3 chars // are largely sufficient. - const int __cs_size = __fixed ? __max_exp + __max_digits + 4 + const int __cs_size = __fixed ? __max_exp + __max_digits + 4 : __max_digits * 3; char* __cs = static_cast<char*>(__builtin_alloca(__cs_size)); _S_format_float(__io, __fbuf, __mod); - __len = std::__convert_from_v(__cs, 0, __fbuf, __v, + __len = std::__convert_from_v(__cs, 0, __fbuf, __v, _S_get_c_locale(), __prec); #endif @@ -996,10 +996,10 @@ namespace std // numpunct.decimal_point() values for '.' and adding grouping. const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); - _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) + _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __len)); __ctype.widen(__cs, __cs + __len, __ws); - + // Replace decimal point. const _CharT __cdec = __ctype.widen('.'); const _CharT __dec = __lc->_M_decimal_point; @@ -1007,12 +1007,12 @@ namespace std if (__p = char_traits<_CharT>::find(__ws, __len, __cdec)) __ws[__p - __ws] = __dec; - // Add grouping, if necessary. + // Add grouping, if necessary. if (__lc->_M_use_grouping) { // Grouping can add (almost) as many separators as the // number of digits, but no more. - _CharT* __ws2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) + _CharT* __ws2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __len * 2)); _M_group_float(__lc->_M_grouping, __lc->_M_grouping_size, __lc->_M_thousands_sep, __p, __ws2, __ws, __len); @@ -1029,7 +1029,7 @@ namespace std __ws = __ws3; } __io.width(0); - + // [22.2.2.2.2] Stage 4. // Write resulting, fully-formatted string to output iterator. return std::__write(__s, __ws, __len); @@ -1053,7 +1053,7 @@ namespace std const locale& __loc = __io._M_getloc(); const __cache_type* __lc = __uc(__loc); - const _CharT* __name = __v ? __lc->_M_truename + const _CharT* __name = __v ? __lc->_M_truename : __lc->_M_falsename; int __len = __v ? __lc->_M_truename_size : __lc->_M_falsename_size; @@ -1061,7 +1061,7 @@ namespace std const streamsize __w = __io.width(); if (__w > static_cast<streamsize>(__len)) { - _CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) + _CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __w)); _M_pad(__fill, __w, __io, __cs, __name, __len); __name = __cs; @@ -1109,7 +1109,7 @@ namespace std template<typename _CharT, typename _OutIter> _OutIter num_put<_CharT, _OutIter>:: - do_put(iter_type __s, ios_base& __io, char_type __fill, + do_put(iter_type __s, ios_base& __io, char_type __fill, long double __v) const { return _M_insert_float(__s, __io, __fill, 'L', __v); } @@ -1123,8 +1123,8 @@ namespace std const ios_base::fmtflags __fmt = ~(ios_base::showpos | ios_base::basefield | ios_base::uppercase | ios_base::internal); __io.flags(__flags & __fmt | (ios_base::hex | ios_base::showbase)); - - __s = _M_insert_int(__s, __io, __fill, + + __s = _M_insert_int(__s, __io, __fill, reinterpret_cast<unsigned long>(__v)); __io.flags(__flags); return __s; @@ -1134,18 +1134,18 @@ namespace std template<typename _CharT, typename _InIter> _InIter money_get<_CharT, _InIter>:: - do_get(iter_type __beg, iter_type __end, bool __intl, ios_base& __io, + do_get(iter_type __beg, iter_type __end, bool __intl, ios_base& __io, ios_base::iostate& __err, long double& __units) const - { + { string_type __str; - __beg = this->do_get(__beg, __end, __intl, __io, __err, __str); + __beg = this->do_get(__beg, __end, __intl, __io, __err, __str); const int __cs_size = __str.size() + 1; char* __cs = static_cast<char*>(__builtin_alloca(__cs_size)); const locale __loc = __io.getloc(); - const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); + const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); const _CharT* __wcs = __str.c_str(); - __ctype.narrow(__wcs, __wcs + __cs_size, char(), __cs); + __ctype.narrow(__wcs, __wcs + __cs_size, char(), __cs); std::__convert_to_v(__cs, __units, __err, _S_get_c_locale()); return __beg; } @@ -1153,44 +1153,44 @@ namespace std template<typename _CharT, typename _InIter> _InIter money_get<_CharT, _InIter>:: - do_get(iter_type __beg, iter_type __end, bool __intl, ios_base& __io, + do_get(iter_type __beg, iter_type __end, bool __intl, ios_base& __io, ios_base::iostate& __err, string_type& __units) const - { + { // These contortions are quite unfortunate. - typedef moneypunct<_CharT, true> __money_true; - typedef moneypunct<_CharT, false> __money_false; - typedef money_base::part part; - typedef typename string_type::size_type size_type; + typedef moneypunct<_CharT, true> __money_true; + typedef moneypunct<_CharT, false> __money_false; + typedef money_base::part part; + typedef typename string_type::size_type size_type; const locale __loc = __io.getloc(); - const __money_true& __mpt = use_facet<__money_true>(__loc); - const __money_false& __mpf = use_facet<__money_false>(__loc); - const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); + const __money_true& __mpt = use_facet<__money_true>(__loc); + const __money_false& __mpf = use_facet<__money_false>(__loc); + const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); - const money_base::pattern __p = __intl ? __mpt.neg_format() + const money_base::pattern __p = __intl ? __mpt.neg_format() : __mpf.neg_format(); - const string_type __pos_sign = __intl ? __mpt.positive_sign() + const string_type __pos_sign = __intl ? __mpt.positive_sign() : __mpf.positive_sign(); - const string_type __neg_sign = __intl ? __mpt.negative_sign() + const string_type __neg_sign = __intl ? __mpt.negative_sign() : __mpf.negative_sign(); - const char_type __d = __intl ? __mpt.decimal_point() - : __mpf.decimal_point(); - const char_type __sep = __intl ? __mpt.thousands_sep() - : __mpf.thousands_sep(); + const char_type __d = __intl ? __mpt.decimal_point() + : __mpf.decimal_point(); + const char_type __sep = __intl ? __mpt.thousands_sep() + : __mpf.thousands_sep(); const string __grouping = __intl ? __mpt.grouping() : __mpf.grouping(); // Set to deduced positive or negative sign, depending. string_type __sign; // String of grouping info from thousands_sep plucked from __units. - string __grouping_tmp; + string __grouping_tmp; // Marker for thousands_sep position. int __sep_pos = 0; // If input iterator is in a valid state. bool __testvalid = true; // Flag marking when a decimal point is found. - bool __testdecfound = false; + bool __testdecfound = false; // The tentative returned string is stored here. string_type __tmp_units; @@ -1202,10 +1202,10 @@ namespace std switch (__which) { case money_base::symbol: - if (__io.flags() & ios_base::showbase + if (__io.flags() & ios_base::showbase || __i < 2 || __sign.size() > 1 || ((static_cast<part>(__p.field[3]) != money_base::none) - && __i == 2)) + && __i == 2)) { // According to 22.2.6.1.2.2, symbol is required // if (__io.flags() & ios_base::showbase), @@ -1224,7 +1224,7 @@ namespace std __testvalid = false; } break; - case money_base::sign: + case money_base::sign: // Sign might not exist, or be more than one character long. if (__pos_sign.size() && *__beg == __pos_sign[0]) { @@ -1282,12 +1282,12 @@ namespace std case money_base::none: // Only if not at the end of the pattern. if (__i != 3) - for (; __beg != __end + for (; __beg != __end && __ctype.is(ctype_base::space, *__beg); ++__beg); break; } } - + // Need to get the rest of the sign characters, if they exist. if (__sign.size() > 1) { @@ -1296,7 +1296,7 @@ namespace std for (; __beg != __end && __i < __len; ++__i) for (; __beg != __end && *__beg != __sign[__i]; ++__beg); - + if (__i != __len) __testvalid = false; } @@ -1314,7 +1314,7 @@ namespace std __tmp_units.erase(0, __only_zeros ? __tmp_units.size() - 1 : __first); } - + // 22.2.6.1.2, p4 if (__sign.size() && __sign == __neg_sign && __tmp_units[0] != __zero) @@ -1332,11 +1332,11 @@ namespace std __grouping_tmp)) __testvalid = false; } - + // Iff not enough digits were supplied after the decimal-point. if (__testdecfound) { - const int __frac = __intl ? __mpt.frac_digits() + const int __frac = __intl ? __mpt.frac_digits() : __mpf.frac_digits(); if (__frac > 0 && __sep_pos != __frac) __testvalid = false; @@ -1345,7 +1345,7 @@ namespace std else __testvalid = false; - // Iff no more characters are available. + // Iff no more characters are available. if (__beg == __end) __err |= ios_base::eofbit; @@ -1356,7 +1356,7 @@ namespace std // Use the "swap trick" to copy __tmp_units into __units. __tmp_units.swap(__units); - return __beg; + return __beg; } template<typename _CharT, typename _OutIter> @@ -1364,7 +1364,7 @@ namespace std money_put<_CharT, _OutIter>:: do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill, long double __units) const - { + { const locale __loc = __io.getloc(); const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); #ifdef _GLIBCXX_USE_C99 @@ -1373,28 +1373,28 @@ namespace std char* __cs = static_cast<char*>(__builtin_alloca(__cs_size)); // _GLIBCXX_RESOLVE_LIB_DEFECTS // 328. Bad sprintf format modifier in money_put<>::do_put() - int __len = std::__convert_from_v(__cs, __cs_size, "%.0Lf", __units, + int __len = std::__convert_from_v(__cs, __cs_size, "%.0Lf", __units, _S_get_c_locale()); // If the buffer was not large enough, try again with the correct size. if (__len >= __cs_size) { __cs_size = __len + 1; __cs = static_cast<char*>(__builtin_alloca(__cs_size)); - __len = std::__convert_from_v(__cs, __cs_size, "%.0Lf", __units, + __len = std::__convert_from_v(__cs, __cs_size, "%.0Lf", __units, _S_get_c_locale()); } #else - // max_exponent10 + 1 for the integer part, + 2 for sign and '\0'. + // max_exponent10 + 1 for the integer part, + 2 for sign and '\0'. const int __cs_size = numeric_limits<long double>::max_exponent10 + 3; char* __cs = static_cast<char*>(__builtin_alloca(__cs_size)); - int __len = std::__convert_from_v(__cs, 0, "%.0Lf", __units, + int __len = std::__convert_from_v(__cs, 0, "%.0Lf", __units, _S_get_c_locale()); #endif - _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) + _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __cs_size)); __ctype.widen(__cs, __cs + __len, __ws); const string_type __digits(__ws, __len); - return this->do_put(__s, __intl, __io, __fill, __digits); + return this->do_put(__s, __intl, __io, __fill, __digits); } template<typename _CharT, typename _OutIter> @@ -1402,9 +1402,9 @@ namespace std money_put<_CharT, _OutIter>:: do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill, const string_type& __digits) const - { - typedef typename string_type::size_type size_type; - typedef money_base::part part; + { + typedef typename string_type::size_type size_type; + typedef money_base::part part; const locale __loc = __io.getloc(); const size_type __width = static_cast<size_type>(__io.width()); @@ -1412,9 +1412,9 @@ namespace std // These contortions are quite unfortunate. typedef moneypunct<_CharT, true> __money_true; typedef moneypunct<_CharT, false> __money_false; - const __money_true& __mpt = use_facet<__money_true>(__loc); - const __money_false& __mpf = use_facet<__money_false>(__loc); - const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); + const __money_true& __mpt = use_facet<__money_true>(__loc); + const __money_false& __mpf = use_facet<__money_false>(__loc); + const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); // Determine if negative or positive formats are to be used, and // discard leading negative_sign if it is present. @@ -1433,7 +1433,7 @@ namespace std __sign = __intl ? __mpt.negative_sign() : __mpf.negative_sign(); ++__beg; } - + // Look for valid numbers in the current ctype facet within input digits. __end = __ctype.scan_not(ctype_base::digit, __beg, __end); if (__beg != __end) @@ -1443,15 +1443,15 @@ namespace std // final_value = grouped units + (decimal point) + (digits) string_type __res; string_type __value; - const string_type __symbol = __intl ? __mpt.curr_symbol() - : __mpf.curr_symbol(); + const string_type __symbol = __intl ? __mpt.curr_symbol() + : __mpf.curr_symbol(); // Deal with decimal point, decimal digits. - const int __frac = __intl ? __mpt.frac_digits() - : __mpf.frac_digits(); + const int __frac = __intl ? __mpt.frac_digits() + : __mpf.frac_digits(); if (__frac > 0) { - const char_type __d = __intl ? __mpt.decimal_point() + const char_type __d = __intl ? __mpt.decimal_point() : __mpf.decimal_point(); if (__end - __beg >= __frac) { @@ -1475,18 +1475,18 @@ namespace std // grouping rules. if (__beg != __end) { - const string __grouping = __intl ? __mpt.grouping() + const string __grouping = __intl ? __mpt.grouping() : __mpf.grouping(); if (__grouping.size()) { - const char_type __sep = __intl ? __mpt.thousands_sep() - : __mpf.thousands_sep(); + const char_type __sep = __intl ? __mpt.thousands_sep() + : __mpf.thousands_sep(); const char* __gbeg = __grouping.data(); const size_t __glen = __grouping.size(); const int __n = (__end - __beg) * 2; _CharT* __ws2 = - static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __n)); - _CharT* __ws_end = std::__add_grouping(__ws2, __sep, __gbeg, + static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __n)); + _CharT* __ws_end = std::__add_grouping(__ws2, __sep, __gbeg, __glen, __beg, __end); __value.insert(0, __ws2, __ws_end - __ws2); } @@ -1510,7 +1510,7 @@ namespace std if (__io.flags() & ios_base::showbase) __res += __symbol; break; - case money_base::sign: + case money_base::sign: // Sign might not exist, or be more than one // charater long. In that case, add in the rest // below. @@ -1557,7 +1557,7 @@ namespace std __s = std::__write(__s, __res.data(), __len); } __io.width(0); - return __s; + return __s; } @@ -1577,12 +1577,12 @@ namespace std void time_get<_CharT, _InIter>:: _M_extract_via_format(iter_type& __beg, iter_type& __end, ios_base& __io, - ios_base::iostate& __err, tm* __tm, + ios_base::iostate& __err, tm* __tm, const _CharT* __format) const - { + { const locale __loc = __io.getloc(); const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc); - const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); + const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); const size_t __len = char_traits<_CharT>::length(__format); for (size_t __i = 0; __beg != __end && __i < __len && !__err; ++__i) @@ -1591,7 +1591,7 @@ namespace std { // Verify valid formatting code, attempt to extract. char __c = __ctype.narrow(__format[++__i], 0); - int __mem = 0; + int __mem = 0; if (__c == 'E' || __c == 'O') __c = __ctype.narrow(__format[++__i], 0); switch (__c) @@ -1602,14 +1602,14 @@ namespace std // Abbreviated weekday name [tm_wday] const char_type* __days1[7]; __tp._M_days_abbreviated(__days1); - _M_extract_name(__beg, __end, __tm->tm_wday, __days1, 7, + _M_extract_name(__beg, __end, __tm->tm_wday, __days1, 7, __ctype, __err); break; case 'A': // Weekday name [tm_wday]. const char_type* __days2[7]; __tp._M_days(__days2); - _M_extract_name(__beg, __end, __tm->tm_wday, __days2, 7, + _M_extract_name(__beg, __end, __tm->tm_wday, __days2, 7, __ctype, __err); break; case 'h': @@ -1617,26 +1617,26 @@ namespace std // Abbreviated month name [tm_mon] const char_type* __months1[12]; __tp._M_months_abbreviated(__months1); - _M_extract_name(__beg, __end, __tm->tm_mon, __months1, 12, + _M_extract_name(__beg, __end, __tm->tm_mon, __months1, 12, __ctype, __err); break; case 'B': // Month name [tm_mon]. const char_type* __months2[12]; __tp._M_months(__months2); - _M_extract_name(__beg, __end, __tm->tm_mon, __months2, 12, + _M_extract_name(__beg, __end, __tm->tm_mon, __months2, 12, __ctype, __err); break; case 'c': // Default time and date representation. const char_type* __dt[2]; __tp._M_date_time_formats(__dt); - _M_extract_via_format(__beg, __end, __io, __err, __tm, + _M_extract_via_format(__beg, __end, __io, __err, __tm, __dt[0]); break; case 'd': // Day [01, 31]. [tm_mday] - _M_extract_num(__beg, __end, __tm->tm_mday, 1, 31, 2, + _M_extract_num(__beg, __end, __tm->tm_mday, 1, 31, 2, __ctype, __err); break; case 'e': @@ -1647,13 +1647,13 @@ namespace std __ctype, __err); else _M_extract_num(__beg, __end, __tm->tm_mday, 10, 31, 2, - __ctype, __err); - break; + __ctype, __err); + break; case 'D': // Equivalent to %m/%d/%y.[tm_mon, tm_mday, tm_year] __cs = "%m/%d/%y"; __ctype.widen(__cs, __cs + 9, __wcs); - _M_extract_via_format(__beg, __end, __io, __err, __tm, + _M_extract_via_format(__beg, __end, __io, __err, __tm, __wcs); break; case 'H': @@ -1663,12 +1663,12 @@ namespace std break; case 'I': // Hour [01, 12]. [tm_hour] - _M_extract_num(__beg, __end, __tm->tm_hour, 1, 12, 2, + _M_extract_num(__beg, __end, __tm->tm_hour, 1, 12, 2, __ctype, __err); break; case 'm': // Month [01, 12]. [tm_mon] - _M_extract_num(__beg, __end, __mem, 1, 12, 2, __ctype, + _M_extract_num(__beg, __end, __mem, 1, 12, 2, __ctype, __err); if (!__err) __tm->tm_mon = __mem - 1; @@ -1688,7 +1688,7 @@ namespace std // Equivalent to (%H:%M). __cs = "%H:%M"; __ctype.widen(__cs, __cs + 6, __wcs); - _M_extract_via_format(__beg, __end, __io, __err, __tm, + _M_extract_via_format(__beg, __end, __io, __err, __tm, __wcs); break; case 'S': @@ -1706,32 +1706,32 @@ namespace std // Equivalent to (%H:%M:%S). __cs = "%H:%M:%S"; __ctype.widen(__cs, __cs + 9, __wcs); - _M_extract_via_format(__beg, __end, __io, __err, __tm, + _M_extract_via_format(__beg, __end, __io, __err, __tm, __wcs); break; case 'x': // Locale's date. const char_type* __dates[2]; __tp._M_date_formats(__dates); - _M_extract_via_format(__beg, __end, __io, __err, __tm, + _M_extract_via_format(__beg, __end, __io, __err, __tm, __dates[0]); break; case 'X': // Locale's time. const char_type* __times[2]; __tp._M_time_formats(__times); - _M_extract_via_format(__beg, __end, __io, __err, __tm, + _M_extract_via_format(__beg, __end, __io, __err, __tm, __times[0]); break; case 'y': case 'C': // C99 // Two digit year. [tm_year] - _M_extract_num(__beg, __end, __tm->tm_year, 0, 99, 2, + _M_extract_num(__beg, __end, __tm->tm_year, 0, 99, 2, __ctype, __err); break; case 'Y': // Year [1900). [tm_year] - _M_extract_num(__beg, __end, __mem, 0, 9999, 4, + _M_extract_num(__beg, __end, __mem, 0, 9999, 4, __ctype, __err); if (!__err) __tm->tm_year = __mem - 1900; @@ -1741,20 +1741,20 @@ namespace std if (__ctype.is(ctype_base::upper, *__beg)) { int __tmp; - _M_extract_name(__beg, __end, __tmp, - __timepunct_cache<_CharT>::_S_timezones, + _M_extract_name(__beg, __end, __tmp, + __timepunct_cache<_CharT>::_S_timezones, 14, __ctype, __err); - + // GMT requires special effort. if (__beg != __end && !__err && __tmp == 0 - && (*__beg == __ctype.widen('-') + && (*__beg == __ctype.widen('-') || *__beg == __ctype.widen('+'))) { _M_extract_num(__beg, __end, __tmp, 0, 23, 2, __ctype, __err); _M_extract_num(__beg, __end, __tmp, 0, 59, 2, __ctype, __err); - } + } } else __err |= ios_base::failbit; @@ -1779,8 +1779,8 @@ namespace std void time_get<_CharT, _InIter>:: _M_extract_num(iter_type& __beg, iter_type& __end, int& __member, - int __min, int __max, size_t __len, - const ctype<_CharT>& __ctype, + int __min, int __max, size_t __len, + const ctype<_CharT>& __ctype, ios_base::iostate& __err) const { // As-is works for __len = 1, 2, 4, the values actually used. @@ -1815,19 +1815,19 @@ namespace std void time_get<_CharT, _InIter>:: _M_extract_name(iter_type& __beg, iter_type& __end, int& __member, - const _CharT** __names, size_t __indexlen, - const ctype<_CharT>& __ctype, + const _CharT** __names, size_t __indexlen, + const ctype<_CharT>& __ctype, ios_base::iostate& __err) const { - typedef char_traits<_CharT> __traits_type; - int* __matches = static_cast<int*>(__builtin_alloca(sizeof(int) + typedef char_traits<_CharT> __traits_type; + int* __matches = static_cast<int*>(__builtin_alloca(sizeof(int) * __indexlen)); size_t __nmatches = 0; size_t __pos = 0; bool __testvalid = true; const char_type* __name; - // Look for initial matches. + // Look for initial matches. // NB: Some of the locale data is in the form of all lowercase // names, and some is in the form of initially-capitalized // names. Look for both. @@ -1835,17 +1835,17 @@ namespace std { const char_type __c = *__beg; for (size_t __i1 = 0; __i1 < __indexlen; ++__i1) - if (__c == __names[__i1][0] + if (__c == __names[__i1][0] || __c == __ctype.toupper(__names[__i1][0])) __matches[__nmatches++] = __i1; } - + while (__nmatches > 1) { // Find smallest matching string. size_t __minlen = 10; for (size_t __i2 = 0; __i2 < __nmatches; ++__i2) - __minlen = std::min(__minlen, + __minlen = std::min(__minlen, __traits_type::length(__names[__matches[__i2]])); ++__beg; if (__pos < __minlen && __beg != __end) @@ -1925,13 +1925,13 @@ namespace std template<typename _CharT, typename _InIter> _InIter time_get<_CharT, _InIter>:: - do_get_weekday(iter_type __beg, iter_type __end, ios_base& __io, + do_get_weekday(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm) const { - typedef char_traits<_CharT> __traits_type; + typedef char_traits<_CharT> __traits_type; const locale __loc = __io.getloc(); const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc); - const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); + const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); const char_type* __days[7]; __tp._M_days_abbreviated(__days); int __tmpwday; @@ -1942,7 +1942,7 @@ namespace std // exact same order, first to last, such that the resulting // __days array with the same index points to a day, and that // day's abbreviated form. - // NB: Also assumes that an abbreviated name is a subset of the name. + // NB: Also assumes that an abbreviated name is a subset of the name. if (!__err) { size_t __pos = __traits_type::length(__days[__tmpwday]); @@ -1952,7 +1952,7 @@ namespace std { // Extract the rest of it. const size_t __len = __traits_type::length(__name); - while (__pos < __len && __beg != __end + while (__pos < __len && __beg != __end && __name[__pos] == *__beg) ++__beg, ++__pos; if (__len != __pos) @@ -1972,10 +1972,10 @@ namespace std do_get_monthname(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm) const { - typedef char_traits<_CharT> __traits_type; + typedef char_traits<_CharT> __traits_type; const locale __loc = __io.getloc(); const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc); - const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); + const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); const char_type* __months[12]; __tp._M_months_abbreviated(__months); int __tmpmon; @@ -1986,7 +1986,7 @@ namespace std // exact same order, first to last, such that the resulting // __months array with the same index points to a month, and that // month's abbreviated form. - // NB: Also assumes that an abbreviated name is a subset of the name. + // NB: Also assumes that an abbreviated name is a subset of the name. if (!__err) { size_t __pos = __traits_type::length(__months[__tmpmon]); @@ -1996,7 +1996,7 @@ namespace std { // Extract the rest of it. const size_t __len = __traits_type::length(__name); - while (__pos < __len && __beg != __end + while (__pos < __len && __beg != __end && __name[__pos] == *__beg) ++__beg, ++__pos; if (__len != __pos) @@ -2005,7 +2005,7 @@ namespace std if (!__err) __tm->tm_mon = __tmpmon; } - + if (__beg == __end) __err |= ios_base::eofbit; return __beg; @@ -2014,11 +2014,11 @@ namespace std template<typename _CharT, typename _InIter> _InIter time_get<_CharT, _InIter>:: - do_get_year(iter_type __beg, iter_type __end, ios_base& __io, + do_get_year(iter_type __beg, iter_type __end, ios_base& __io, ios_base::iostate& __err, tm* __tm) const { const locale __loc = __io.getloc(); - const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); + const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); size_t __i = 0; int __value = 0; @@ -2031,7 +2031,7 @@ namespace std break; } if (__i == 2 || __i == 4) - __tm->tm_year = __i == 2 ? __value : __value - 1900; + __tm->tm_year = __i == 2 ? __value : __value - 1900; else __err |= ios_base::failbit; if (__beg == __end) @@ -2042,7 +2042,7 @@ namespace std template<typename _CharT, typename _OutIter> _OutIter time_put<_CharT, _OutIter>:: - put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm, + put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm, const _CharT* __beg, const _CharT* __end) const { const locale __loc = __io.getloc(); @@ -2078,9 +2078,9 @@ namespace std template<typename _CharT, typename _OutIter> _OutIter time_put<_CharT, _OutIter>:: - do_put(iter_type __s, ios_base& __io, char_type, const tm* __tm, + do_put(iter_type __s, ios_base& __io, char_type, const tm* __tm, char __format, char __mod) const - { + { const locale __loc = __io.getloc(); ctype<_CharT> const& __ctype = use_facet<ctype<_CharT> >(__loc); __timepunct<_CharT> const& __tp = use_facet<__timepunct<_CharT> >(__loc); @@ -2097,7 +2097,7 @@ namespace std // format character: if __mod is not the default argument, assume // it's a valid modifier. char_type __fmt[4]; - __fmt[0] = __ctype.widen('%'); + __fmt[0] = __ctype.widen('%'); if (!__mod) { __fmt[1] = __format; @@ -2132,9 +2132,9 @@ namespace std template<typename _CharT> int collate<_CharT>:: - do_compare(const _CharT* __lo1, const _CharT* __hi1, + do_compare(const _CharT* __lo1, const _CharT* __hi1, const _CharT* __lo2, const _CharT* __hi2) const - { + { // strcoll assumes zero-terminated strings so we make a copy // and then put a zero at the end. const string_type __one(__lo1, __hi1); @@ -2197,7 +2197,7 @@ namespace std if (__res >= __len) { __len = __res + 1; - __c = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) + __c = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __len)); __res = _M_transform(__c, __p, __res + 1); } @@ -2216,16 +2216,16 @@ namespace std long collate<_CharT>:: do_hash(const _CharT* __lo, const _CharT* __hi) const - { + { unsigned long __val = 0; for (; __lo < __hi; ++__lo) - __val = *__lo + ((__val << 7) | + __val = *__lo + ((__val << 7) | (__val >> (numeric_limits<unsigned long>::digits - 7))); return static_cast<long>(__val); } // Construct correctly padded string, as per 22.2.2.2.2 - // Assumes + // Assumes // __newlen > __oldlen // __news is allocated for __newlen size // Used by both num_put and ostream inserters: if __num, @@ -2236,10 +2236,10 @@ namespace std // NB: Of the two parameters, _CharT can be deduced from the // function arguments. The other (_Traits) has to be explicitly specified. template<typename _CharT, typename _Traits> - void - __pad<_CharT, _Traits>::_S_pad(ios_base& __io, _CharT __fill, - _CharT* __news, const _CharT* __olds, - const streamsize __newlen, + void + __pad<_CharT, _Traits>::_S_pad(ios_base& __io, _CharT __fill, + _CharT* __news, const _CharT* __olds, + const streamsize __newlen, const streamsize __oldlen, const bool __num) { const size_t __plen = static_cast<size_t>(__newlen - __oldlen); @@ -2260,18 +2260,18 @@ namespace std // Pad after 0[xX], if there is one. // Who came up with these rules, anyway? Jeeze. const locale& __loc = __io._M_getloc(); - const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); + const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); const _CharT __minus = __ctype.widen('-'); const _CharT __plus = __ctype.widen('+'); const bool __testsign = _Traits::eq(__olds[0], __minus) || _Traits::eq(__olds[0], __plus); - const bool __testhex = _Traits::eq(__ctype.widen('0'), __olds[0]) - && (_Traits::eq(__ctype.widen('x'), __olds[1]) + const bool __testhex = _Traits::eq(__ctype.widen('0'), __olds[0]) + && (_Traits::eq(__ctype.widen('x'), __olds[1]) || _Traits::eq(__ctype.widen('X'), __olds[1])); if (__testhex) { - __news[0] = __olds[0]; + __news[0] = __olds[0]; __news[1] = __olds[1]; __mod = 2; __news += 2; @@ -2292,7 +2292,7 @@ namespace std bool __verify_grouping(const char* __grouping, size_t __grouping_size, const string& __grouping_tmp) - { + { const size_t __n = __grouping_tmp.size() - 1; const size_t __min = std::min(__n, __grouping_size - 1); size_t __i = __n; @@ -2333,7 +2333,7 @@ namespace std } // Inhibit implicit instantiations for required instantiations, - // which are defined via explicit instantiations elsewhere. + // which are defined via explicit instantiations elsewhere. // NB: This syntax is a GNU extension. #if _GLIBCXX_EXTERN_TEMPLATE extern template class moneypunct<char, false>; @@ -2345,7 +2345,7 @@ namespace std extern template class numpunct<char>; extern template class numpunct_byname<char>; extern template class num_get<char>; - extern template class num_put<char>; + extern template class num_put<char>; extern template class __timepunct<char>; extern template class time_put<char>; extern template class time_put_byname<char>; @@ -2359,106 +2359,106 @@ namespace std extern template class collate_byname<char>; extern template - const codecvt<char, char, mbstate_t>& + const codecvt<char, char, mbstate_t>& use_facet<codecvt<char, char, mbstate_t> >(const locale&); extern template - const collate<char>& + const collate<char>& use_facet<collate<char> >(const locale&); extern template - const numpunct<char>& + const numpunct<char>& use_facet<numpunct<char> >(const locale&); - extern template - const num_put<char>& + extern template + const num_put<char>& use_facet<num_put<char> >(const locale&); - extern template - const num_get<char>& + extern template + const num_get<char>& use_facet<num_get<char> >(const locale&); extern template - const moneypunct<char, true>& + const moneypunct<char, true>& use_facet<moneypunct<char, true> >(const locale&); extern template - const moneypunct<char, false>& + const moneypunct<char, false>& use_facet<moneypunct<char, false> >(const locale&); - extern template - const money_put<char>& + extern template + const money_put<char>& use_facet<money_put<char> >(const locale&); - extern template - const money_get<char>& + extern template + const money_get<char>& use_facet<money_get<char> >(const locale&); extern template - const __timepunct<char>& + const __timepunct<char>& use_facet<__timepunct<char> >(const locale&); - extern template - const time_put<char>& + extern template + const time_put<char>& use_facet<time_put<char> >(const locale&); - extern template - const time_get<char>& + extern template + const time_get<char>& use_facet<time_get<char> >(const locale&); - extern template - const messages<char>& + extern template + const messages<char>& use_facet<messages<char> >(const locale&); - extern template + extern template bool has_facet<ctype<char> >(const locale&); - extern template + extern template bool has_facet<codecvt<char, char, mbstate_t> >(const locale&); - extern template + extern template bool has_facet<collate<char> >(const locale&); - extern template + extern template bool has_facet<numpunct<char> >(const locale&); - extern template + extern template bool has_facet<num_put<char> >(const locale&); - extern template + extern template bool has_facet<num_get<char> >(const locale&); - extern template + extern template bool has_facet<moneypunct<char> >(const locale&); - extern template + extern template bool has_facet<money_put<char> >(const locale&); - extern template + extern template bool has_facet<money_get<char> >(const locale&); - extern template + extern template bool has_facet<__timepunct<char> >(const locale&); - extern template + extern template bool has_facet<time_put<char> >(const locale&); - extern template + extern template bool has_facet<time_get<char> >(const locale&); - extern template + extern template bool has_facet<messages<char> >(const locale&); @@ -2486,106 +2486,106 @@ namespace std extern template class collate_byname<wchar_t>; extern template - const codecvt<wchar_t, char, mbstate_t>& + const codecvt<wchar_t, char, mbstate_t>& use_facet<codecvt<wchar_t, char, mbstate_t> >(locale const&); extern template - const collate<wchar_t>& + const collate<wchar_t>& use_facet<collate<wchar_t> >(const locale&); extern template - const numpunct<wchar_t>& + const numpunct<wchar_t>& use_facet<numpunct<wchar_t> >(const locale&); - extern template - const num_put<wchar_t>& + extern template + const num_put<wchar_t>& use_facet<num_put<wchar_t> >(const locale&); - extern template - const num_get<wchar_t>& + extern template + const num_get<wchar_t>& use_facet<num_get<wchar_t> >(const locale&); extern template - const moneypunct<wchar_t, true>& + const moneypunct<wchar_t, true>& use_facet<moneypunct<wchar_t, true> >(const locale&); extern template - const moneypunct<wchar_t, false>& + const moneypunct<wchar_t, false>& use_facet<moneypunct<wchar_t, false> >(const locale&); - - extern template - const money_put<wchar_t>& + + extern template + const money_put<wchar_t>& use_facet<money_put<wchar_t> >(const locale&); - extern template - const money_get<wchar_t>& + extern template + const money_get<wchar_t>& use_facet<money_get<wchar_t> >(const locale&); extern template - const __timepunct<wchar_t>& + const __timepunct<wchar_t>& use_facet<__timepunct<wchar_t> >(const locale&); - extern template - const time_put<wchar_t>& + extern template + const time_put<wchar_t>& use_facet<time_put<wchar_t> >(const locale&); - extern template - const time_get<wchar_t>& + extern template + const time_get<wchar_t>& use_facet<time_get<wchar_t> >(const locale&); - extern template - const messages<wchar_t>& + extern template + const messages<wchar_t>& use_facet<messages<wchar_t> >(const locale&); - extern template + extern template bool has_facet<ctype<wchar_t> >(const locale&); - extern template + extern template bool has_facet<codecvt<wchar_t, char, mbstate_t> >(const locale&); - extern template + extern template bool has_facet<collate<wchar_t> >(const locale&); - extern template + extern template bool has_facet<numpunct<wchar_t> >(const locale&); - extern template + extern template bool has_facet<num_put<wchar_t> >(const locale&); - extern template + extern template bool has_facet<num_get<wchar_t> >(const locale&); - extern template + extern template bool has_facet<moneypunct<wchar_t> >(const locale&); - extern template + extern template bool has_facet<money_put<wchar_t> >(const locale&); - extern template + extern template bool has_facet<money_get<wchar_t> >(const locale&); - extern template + extern template bool has_facet<__timepunct<wchar_t> >(const locale&); - extern template + extern template bool has_facet<time_put<wchar_t> >(const locale&); - extern template + extern template bool has_facet<time_get<wchar_t> >(const locale&); - extern template + extern template bool has_facet<messages<wchar_t> >(const locale&); #endif diff --git a/libstdc++-v3/include/bits/localefwd.h b/libstdc++-v3/include/bits/localefwd.h index a4507c3e28f..247158df374 100644 --- a/libstdc++-v3/include/bits/localefwd.h +++ b/libstdc++-v3/include/bits/localefwd.h @@ -44,7 +44,7 @@ #include <bits/c++config.h> #include <bits/c++locale.h> // Defines __c_locale, config-specific includes -#include <iosfwd> // For ostreambuf_iterator, istreambuf_iterator +#include <iosfwd> // For ostreambuf_iterator, istreambuf_iterator #include <bits/functexcept.h> namespace std @@ -53,67 +53,67 @@ namespace std class locale; // 22.1.3 Convenience interfaces - template<typename _CharT> - inline bool + template<typename _CharT> + inline bool isspace(_CharT, const locale&); - template<typename _CharT> - inline bool + template<typename _CharT> + inline bool isprint(_CharT, const locale&); - template<typename _CharT> - inline bool + template<typename _CharT> + inline bool iscntrl(_CharT, const locale&); - template<typename _CharT> - inline bool + template<typename _CharT> + inline bool isupper(_CharT, const locale&); - template<typename _CharT> - inline bool + template<typename _CharT> + inline bool islower(_CharT, const locale&); - template<typename _CharT> - inline bool + template<typename _CharT> + inline bool isalpha(_CharT, const locale&); - template<typename _CharT> - inline bool + template<typename _CharT> + inline bool isdigit(_CharT, const locale&); - template<typename _CharT> - inline bool + template<typename _CharT> + inline bool ispunct(_CharT, const locale&); - template<typename _CharT> - inline bool + template<typename _CharT> + inline bool isxdigit(_CharT, const locale&); - template<typename _CharT> - inline bool + template<typename _CharT> + inline bool isalnum(_CharT, const locale&); - template<typename _CharT> - inline bool + template<typename _CharT> + inline bool isgraph(_CharT, const locale&); - template<typename _CharT> - inline _CharT + template<typename _CharT> + inline _CharT toupper(_CharT, const locale&); - template<typename _CharT> - inline _CharT + template<typename _CharT> + inline _CharT tolower(_CharT, const locale&); // 22.2.1 and 22.2.1.3 ctype class ctype_base; - template<typename _CharT> + template<typename _CharT> class ctype; template<> class ctype<char>; #ifdef _GLIBCXX_USE_WCHAR_T template<> class ctype<wchar_t>; #endif - template<typename _CharT> + template<typename _CharT> class ctype_byname; // NB: Specialized for char and wchar_t in locale_facets.h. @@ -137,9 +137,9 @@ namespace std template<typename _CharT> class numpunct_byname; // 22.2.4 collation - template<typename _CharT> + template<typename _CharT> class collate; - template<typename _CharT> class + template<typename _CharT> class collate_byname; // 22.2.5 date and time @@ -159,16 +159,16 @@ namespace std class money_get; template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> > class money_put; - template<typename _CharT, bool _Intl = false> + template<typename _CharT, bool _Intl = false> class moneypunct; - template<typename _CharT, bool _Intl = false> + template<typename _CharT, bool _Intl = false> class moneypunct_byname; // 22.2.7 message retrieval class messages_base; - template<typename _CharT> + template<typename _CharT> class messages; - template<typename _CharT> + template<typename _CharT> class messages_byname; template<typename _Facet> @@ -182,9 +182,9 @@ namespace std template<typename _Facet> inline const _Facet& __check_facet(const _Facet* __f) - { + { if (!__f) - __throw_bad_cast(); + __throw_bad_cast(); return *__f; } } // namespace std diff --git a/libstdc++-v3/include/bits/mask_array.h b/libstdc++-v3/include/bits/mask_array.h index d11e3fd4f25..ce13c1a9920 100644 --- a/libstdc++-v3/include/bits/mask_array.h +++ b/libstdc++-v3/include/bits/mask_array.h @@ -57,23 +57,23 @@ namespace std { * * @param Tp Element type. */ - template <class _Tp> + template <class _Tp> class mask_array - { + { public: typedef _Tp value_type; - + void operator=(const valarray<_Tp>&) const; /// Multiply slice elements by corresponding elements of @a v. void operator*=(const valarray<_Tp>&) const; /// Divide slice elements by corresponding elements of @a v. void operator/=(const valarray<_Tp>&) const; /// Modulo slice elements by corresponding elements of @a v. - void operator%=(const valarray<_Tp>&) const; + void operator%=(const valarray<_Tp>&) const; /// Add corresponding elements of @a v to slice elements. void operator+=(const valarray<_Tp>&) const; /// Subtract corresponding elements of @a v from slice elements. - void operator-=(const valarray<_Tp>&) const; + void operator-=(const valarray<_Tp>&) const; /// Logical xor slice elements with corresponding elements of @a v. void operator^=(const valarray<_Tp>&) const; /// Logical and slice elements with corresponding elements of @a v. @@ -83,12 +83,12 @@ namespace std { /// Left shift slice elements by corresponding elements of @a v. void operator<<=(const valarray<_Tp>&) const; /// Right shift slice elements by corresponding elements of @a v. - void operator>>=(const valarray<_Tp>&) const; + void operator>>=(const valarray<_Tp>&) const; /// Assign all slice elements to @a t. void operator=(const _Tp&) const; - + // ~mask_array (); - + template<class _Dom> void operator=(const _Expr<_Dom,_Tp>&) const; template<class _Dom> @@ -110,19 +110,19 @@ namespace std { template<class _Dom> void operator<<=(const _Expr<_Dom,_Tp>&) const; template<class _Dom> - void operator>>=(const _Expr<_Dom,_Tp>&) const; + void operator>>=(const _Expr<_Dom,_Tp>&) const; private: mask_array(_Array<_Tp>, size_t, _Array<bool>); friend class valarray<_Tp>; - + const size_t _M_sz; const _Array<bool> _M_mask; const _Array<_Tp> _M_array; - + /// Copy constructor. Both slices refer to the same underlying array. mask_array (const mask_array&); - + // not implemented mask_array(); @@ -137,15 +137,15 @@ namespace std { : _M_sz(a._M_sz), _M_mask(a._M_mask), _M_array(a._M_array) {} template<typename _Tp> - inline + inline mask_array<_Tp>::mask_array(_Array<_Tp> __a, size_t __s, _Array<bool> __m) : _M_sz(__s), _M_mask(__m), _M_array(__a) {} - + template<typename _Tp> inline void mask_array<_Tp>::operator=(const _Tp& __t) const { std::__valarray_fill(_M_array, _M_sz, _M_mask, __t); } - + template<typename _Tp> inline void mask_array<_Tp>::operator=(const valarray<_Tp>& __v) const @@ -186,8 +186,8 @@ _DEFINE_VALARRAY_OPERATOR(|, __bitwise_or) _DEFINE_VALARRAY_OPERATOR(<<, __shift_left) _DEFINE_VALARRAY_OPERATOR(>>, __shift_right) -#undef _DEFINE_VALARRAY_OPERATOR - +#undef _DEFINE_VALARRAY_OPERATOR + } // std:: #endif /* _MASK_ARRAY_H */ diff --git a/libstdc++-v3/include/bits/ostream.tcc b/libstdc++-v3/include/bits/ostream.tcc index c8f7fc73c35..1ff14a66ae3 100644 --- a/libstdc++-v3/include/bits/ostream.tcc +++ b/libstdc++-v3/include/bits/ostream.tcc @@ -39,7 +39,7 @@ #include <locale> -namespace std +namespace std { template<typename _CharT, typename _Traits> basic_ostream<_CharT, _Traits>::sentry:: @@ -58,9 +58,9 @@ namespace std __os.setstate(ios_base::failbit); } } - + template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& + basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>:: operator<<(__ostream_type& (*__pf)(__ostream_type&)) { @@ -69,9 +69,9 @@ namespace std // The inserters for manipulators are *not* formatted output functions. return __pf(*this); } - + template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& + basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>:: operator<<(__ios_type& (*__pf)(__ios_type&)) { @@ -83,7 +83,7 @@ namespace std } template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& + basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>:: operator<<(ios_base& (*__pf)(ios_base&)) { @@ -95,15 +95,15 @@ namespace std } template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& + basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>:: operator<<(bool __n) { sentry __cerb(*this); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { const __num_put_type& __np = __check_facet(this->_M_num_put); if (__np.put(*this, *this, this->fill(), __n).failed()) @@ -118,15 +118,15 @@ namespace std } template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& + basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>:: operator<<(long __n) { sentry __cerb(*this); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { bool __b = false; char_type __c = this->fill(); @@ -139,7 +139,7 @@ namespace std } else __b = __np.put(*this, *this, __c, __n).failed(); - if (__b) + if (__b) __err |= ios_base::badbit; } catch(...) @@ -151,15 +151,15 @@ namespace std } template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& + basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>:: operator<<(unsigned long __n) { sentry __cerb(*this); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { const __num_put_type& __np = __check_facet(this->_M_num_put); if (__np.put(*this, *this, this->fill(), __n).failed()) @@ -175,15 +175,15 @@ namespace std #ifdef _GLIBCXX_USE_LONG_LONG template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& + basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>:: operator<<(long long __n) { sentry __cerb(*this); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { bool __b = false; char_type __c = this->fill(); @@ -197,7 +197,7 @@ namespace std } else __b = __np.put(*this, *this, __c, __n).failed(); - if (__b) + if (__b) __err |= ios_base::badbit; } catch(...) @@ -209,15 +209,15 @@ namespace std } template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& + basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>:: operator<<(unsigned long long __n) { sentry __cerb(*this); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { const __num_put_type& __np = __check_facet(this->_M_num_put); if (__np.put(*this, *this, this->fill(), __n).failed()) @@ -231,17 +231,17 @@ namespace std return *this; } #endif - + template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& + basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>:: operator<<(double __n) { sentry __cerb(*this); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { const __num_put_type& __np = __check_facet(this->_M_num_put); if (__np.put(*this, *this, this->fill(), __n).failed()) @@ -254,17 +254,17 @@ namespace std } return *this; } - + template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& + basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>:: operator<<(long double __n) { sentry __cerb(*this); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { const __num_put_type& __np = __check_facet(this->_M_num_put); if (__np.put(*this, *this, this->fill(), __n).failed()) @@ -279,15 +279,15 @@ namespace std } template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& + basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>:: operator<<(const void* __n) { sentry __cerb(*this); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); - try + try { const __num_put_type& __np = __check_facet(this->_M_num_put); if (__np.put(*this, *this, this->fill(), __n).failed()) @@ -302,7 +302,7 @@ namespace std } template<typename _CharT, typename _Traits> - basic_ostream<_CharT, _Traits>& + basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>:: operator<<(__streambuf_type* __sbin) { @@ -329,7 +329,7 @@ namespace std basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>:: put(char_type __c) - { + { // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 60. What is a formatted input function? // basic_ostream::put(char_type) is an unformatted output function. @@ -337,12 +337,12 @@ namespace std // Unformatted output functions should catch exceptions thrown // from streambuf members. sentry __cerb(*this); - if (__cerb) + if (__cerb) { ios_base::iostate __err = ios_base::iostate(ios_base::goodbit); try { - int_type __put = this->rdbuf()->sputc(__c); + int_type __put = this->rdbuf()->sputc(__c); if (traits_type::eq_int_type(__put, traits_type::eof())) __err |= ios_base::badbit; } @@ -351,7 +351,7 @@ namespace std if (__err) this->setstate(__err); } - return *this; + return *this; } template<typename _CharT, typename _Traits> @@ -397,7 +397,7 @@ namespace std this->setstate(__err); return *this; } - + template<typename _CharT, typename _Traits> typename basic_ostream<_CharT, _Traits>::pos_type basic_ostream<_CharT, _Traits>:: @@ -427,7 +427,7 @@ namespace std // _GLIBCXX_RESOLVE_LIB_DEFECTS // 136. seekp, seekg setting wrong streams? pos_type __p = this->rdbuf()->pubseekpos(__pos, ios_base::out); - + // 129. Need error indication from seekp() and seekg() if (__p == pos_type(off_type(-1))) __err |= ios_base::failbit; @@ -452,9 +452,9 @@ namespace std { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 136. seekp, seekg setting wrong streams? - pos_type __p = this->rdbuf()->pubseekoff(__off, __dir, + pos_type __p = this->rdbuf()->pubseekoff(__off, __dir, ios_base::out); - + // 129. Need error indication from seekp() and seekg() if (__p == pos_type(off_type(-1))) __err |= ios_base::failbit; @@ -476,7 +476,7 @@ namespace std typename __ostream_type::sentry __cerb(__out); if (__cerb) { - try + try { const streamsize __w = __out.width(); streamsize __len = 1; @@ -485,7 +485,7 @@ namespace std { __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __w)); - __pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs, + __pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs, &__c, __w, __len, false); __len = __w; } @@ -497,9 +497,9 @@ namespace std } return __out; } - + // Specializations. - template <class _Traits> + template <class _Traits> basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>& __out, char __c) { @@ -507,7 +507,7 @@ namespace std typename __ostream_type::sentry __cerb(__out); if (__cerb) { - try + try { const streamsize __w = __out.width(); streamsize __len = 1; @@ -515,7 +515,7 @@ namespace std if (__w > __len) { __cs = static_cast<char*>(__builtin_alloca(__w)); - __pad<char, _Traits>::_S_pad(__out, __out.fill(), __cs, + __pad<char, _Traits>::_S_pad(__out, __out.fill(), __cs, &__c, __w, __len, false); __len = __w; } @@ -536,7 +536,7 @@ namespace std typename __ostream_type::sentry __cerb(__out); if (__cerb && __s) { - try + try { const streamsize __w = __out.width(); streamsize __len = static_cast<streamsize>(_Traits::length(__s)); @@ -544,7 +544,7 @@ namespace std { _CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __w)); - __pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs, + __pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs, __s, __w, __len, false); __s = __cs; __len = __w; @@ -578,8 +578,8 @@ namespace std for (size_t __i = 0; __i < __clen; ++__i) __ws[__i] = __out.widen(__s[__i]); _CharT* __str = __ws; - - try + + try { const streamsize __w = __out.width(); streamsize __len = static_cast<streamsize>(__clen); @@ -587,7 +587,7 @@ namespace std { _CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __w)); - __pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs, + __pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs, __ws, __w, __len, false); __str = __cs; __len = __w; @@ -612,14 +612,14 @@ namespace std typename __ostream_type::sentry __cerb(__out); if (__cerb && __s) { - try + try { const streamsize __w = __out.width(); streamsize __len = static_cast<streamsize>(_Traits::length(__s)); if (__w > __len) { char* __cs = static_cast<char*>(__builtin_alloca(__w)); - __pad<char, _Traits>::_S_pad(__out, __out.fill(), __cs, + __pad<char, _Traits>::_S_pad(__out, __out.fill(), __cs, __s, __w, __len, false); __s = __cs; __len = __w; @@ -640,7 +640,7 @@ namespace std basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __out, const basic_string<_CharT, _Traits, _Alloc>& __str) - { + { typedef basic_ostream<_CharT, _Traits> __ostream_type; typename __ostream_type::sentry __cerb(__out); if (__cerb) @@ -666,7 +666,7 @@ namespace std } // Inhibit implicit instantiations for required instantiations, - // which are defined via explicit instantiations elsewhere. + // which are defined via explicit instantiations elsewhere. // NB: This syntax is a GNU extension. #if _GLIBCXX_EXTERN_TEMPLATE extern template class basic_ostream<char>; diff --git a/libstdc++-v3/include/bits/postypes.h b/libstdc++-v3/include/bits/postypes.h index cd0594c45c2..5db3d7b1d59 100644 --- a/libstdc++-v3/include/bits/postypes.h +++ b/libstdc++-v3/include/bits/postypes.h @@ -158,8 +158,8 @@ namespace std private: friend class streamoff; - __streamoff_base_type _M_off; - _StateT _M_state; + __streamoff_base_type _M_off; + _StateT _M_state; public: // The standard doesn't require that fpos objects can be default diff --git a/libstdc++-v3/include/bits/slice_array.h b/libstdc++-v3/include/bits/slice_array.h index 7706fd6410b..571296d9c57 100644 --- a/libstdc++-v3/include/bits/slice_array.h +++ b/libstdc++-v3/include/bits/slice_array.h @@ -69,14 +69,14 @@ namespace std * @param s Stride between array elements. */ slice(size_t, size_t, size_t); - + /// Return array offset of first slice element. size_t start() const; /// Return size of slice. size_t size() const; /// Return array stride of slice. size_t stride() const; - + private: size_t _M_off; // offset size_t _M_sz; // size @@ -85,21 +85,21 @@ namespace std // The default constructor constructor is not required to initialize // data members with any meaningful values, so we choose to do nothing. - inline + inline slice::slice() {} - - inline + + inline slice::slice(size_t __o, size_t __d, size_t __s) : _M_off(__o), _M_sz(__d), _M_st(__s) {} - + inline size_t slice::start() const { return _M_off; } - + inline size_t slice::size() const { return _M_sz; } - + inline size_t slice::stride() const { return _M_st; } @@ -194,16 +194,16 @@ namespace std }; template<typename _Tp> - inline + inline slice_array<_Tp>::slice_array(_Array<_Tp> __a, const slice& __s) : _M_sz(__s.size()), _M_stride(__s.stride()), _M_array(__a.begin() + __s.start()) {} template<typename _Tp> - inline + inline slice_array<_Tp>::slice_array(const slice_array<_Tp>& a) : _M_sz(a._M_sz), _M_stride(a._M_stride), _M_array(a._M_array) {} - + // template<typename _Tp> // inline slice_array<_Tp>::~slice_array () {} @@ -220,12 +220,12 @@ namespace std inline void slice_array<_Tp>::operator=(const _Tp& __t) const { std::__valarray_fill(_M_array, _M_sz, _M_stride, __t); } - + template<typename _Tp> inline void slice_array<_Tp>::operator=(const valarray<_Tp>& __v) const { std::__valarray_copy(_Array<_Tp>(__v), _M_array, _M_sz, _M_stride); } - + template<typename _Tp> template<class _Dom> inline void @@ -248,7 +248,7 @@ namespace std { \ _Array_augmented_##_Name(_M_array, _M_stride, __e, _M_sz); \ } - + _DEFINE_VALARRAY_OPERATOR(*, __multiplies) _DEFINE_VALARRAY_OPERATOR(/, __divides) diff --git a/libstdc++-v3/include/bits/sstream.tcc b/libstdc++-v3/include/bits/sstream.tcc index b3db928a054..df5e619a70d 100644 --- a/libstdc++-v3/include/bits/sstream.tcc +++ b/libstdc++-v3/include/bits/sstream.tcc @@ -42,13 +42,13 @@ namespace std { template <class _CharT, class _Traits, class _Alloc> - typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type + typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type basic_stringbuf<_CharT, _Traits, _Alloc>:: pbackfail(int_type __c) { int_type __ret = traits_type::eof(); const bool __testeof = traits_type::eq_int_type(__c, __ret); - + if (this->eback() < this->gptr()) { const bool __testeq = traits_type::eq(traits_type::to_char_type(__c), @@ -69,9 +69,9 @@ namespace std } return __ret; } - + template <class _CharT, class _Traits, class _Alloc> - typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type + typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type basic_stringbuf<_CharT, _Traits, _Alloc>:: overflow(int_type __c) { @@ -111,7 +111,7 @@ namespace std } template <class _CharT, class _Traits, class _Alloc> - typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type + typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type basic_stringbuf<_CharT, _Traits, _Alloc>:: underflow() { @@ -132,7 +132,7 @@ namespace std basic_stringbuf<_CharT, _Traits, _Alloc>:: seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __mode) { - pos_type __ret = pos_type(off_type(-1)); + pos_type __ret = pos_type(off_type(-1)); bool __testin = (ios_base::in & this->_M_mode & __mode) != 0; bool __testout = (ios_base::out & this->_M_mode & __mode) != 0; const bool __testboth = __testin && __testout && __way != ios_base::cur; @@ -156,14 +156,14 @@ namespace std __newoffo = __newoffi = this->egptr() - __beg; if ((__testin || __testboth) - && __newoffi + __off >= 0 + && __newoffi + __off >= 0 && this->egptr() - __beg >= __newoffi + __off) { this->gbump((__beg + __newoffi + __off) - this->gptr()); __ret = pos_type(__newoffi); } if ((__testout || __testboth) - && __newoffo + __off >= 0 + && __newoffo + __off >= 0 && this->egptr() - __beg >= __newoffo + __off) { this->pbump((__beg + __newoffo + __off) - this->pptr()); @@ -178,14 +178,14 @@ namespace std basic_stringbuf<_CharT, _Traits, _Alloc>:: seekpos(pos_type __sp, ios_base::openmode __mode) { - pos_type __ret = pos_type(off_type(-1)); + pos_type __ret = pos_type(off_type(-1)); if (_M_string.capacity()) { off_type __pos (__sp); const bool __testin = (ios_base::in & this->_M_mode & __mode) != 0; const bool __testout = (ios_base::out & this->_M_mode & __mode) != 0; char_type* __beg = __testin ? this->eback() : this->pbase(); - + _M_update_egptr(); const bool __testpos = 0 <= __pos @@ -203,7 +203,7 @@ namespace std } // Inhibit implicit instantiations for required instantiations, - // which are defined via explicit instantiations elsewhere. + // which are defined via explicit instantiations elsewhere. // NB: This syntax is a GNU extension. #if _GLIBCXX_EXTERN_TEMPLATE extern template class basic_stringbuf<char>; diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h index f33d4e3042f..6fed5786ebd 100644 --- a/libstdc++-v3/include/bits/stl_algo.h +++ b/libstdc++-v3/include/bits/stl_algo.h @@ -211,7 +211,7 @@ namespace std if (*__first == __val) return __first; ++__first; - + if (*__first == __val) return __first; ++__first; @@ -1624,7 +1624,7 @@ namespace std { const _ValueType __tmp = *__first; _RandomAccessIterator __p = __first; - + if (__k < __l) { for (_Distance __j = 0; __j < __l / __d; __j++) @@ -1652,7 +1652,7 @@ namespace std __p -= __l; } } - + *__p = __tmp; ++__first; } @@ -1743,7 +1743,7 @@ namespace std _RandomAccessIterator>) __glibcxx_requires_valid_range(__first, __last); - if (__first != __last) + if (__first != __last) for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i) std::iter_swap(__i, __first + (std::rand() % ((__i - __first) + 1))); } @@ -1850,7 +1850,7 @@ namespace std * @return An iterator @p middle such that @p pred(i) is true for each * iterator @p i in the range @p [first,middle) and false for each @p i * in the range @p [middle,last). - * + * * @p pred must not modify its operand. @p partition() does not preserve * the relative ordering of elements in each group, use * @p stable_partition() if this is needed. @@ -1959,7 +1959,7 @@ namespace std * @return An iterator @p middle such that @p pred(i) is true for each * iterator @p i in the range @p [first,middle) and false for each @p i * in the range @p [middle,last). - * + * * Performs the same function as @p partition() with the additional * guarantee that the relative ordering of elements in each group is * preserved, so any two elements @p x and @p y in the range @@ -2477,10 +2477,10 @@ namespace std std::__unguarded_partition(__first, __last, _ValueType(std::__median(*__first, *(__first - + (__last - - __first) + + (__last + - __first) / 2), - *(__last + *(__last - 1)))); std::__introsort_loop(__cut, __last, __depth_limit); __last = __cut; @@ -3095,7 +3095,7 @@ namespace std __first += __two_step; } __step_size = std::min(_Distance(__last - __first), __step_size); - + std::merge(__first, __first + __step_size, __first + __step_size, __last, __result, @@ -3673,7 +3673,7 @@ namespace std * * Rearranges the elements in the range @p [first,last) so that @p *nth * is the same element that would have been in that position had the - * whole sequence been sorted. + * whole sequence been sorted. * whole sequence been sorted. The elements either side of @p *nth are * not completely sorted, but for any iterator @i in the range * @p [first,nth) and any iterator @j in the range @p [nth,last) it @@ -3753,9 +3753,9 @@ namespace std _RandomAccessIterator __cut = std::__unguarded_partition(__first, __last, _ValueType(std::__median(*__first, - *(__first + *(__first + (__last - - __first) + - __first) / 2), *(__last - 1), __comp)), __comp); @@ -4160,7 +4160,7 @@ namespace std *__result = *__first2; ++__first2; } - else + else { *__result = *__first1; ++__first1; @@ -4168,7 +4168,7 @@ namespace std } ++__result; } - return std::copy(__first2, __last2, std::copy(__first1, __last1, + return std::copy(__first2, __last2, std::copy(__first1, __last1, __result)); } @@ -4225,7 +4225,7 @@ namespace std /** * @brief Return the intersection of two sorted ranges using comparison - * functor. + * functor. * @param first1 Start of first range. * @param last1 End of first range. * @param first2 Start of second range. @@ -4446,7 +4446,7 @@ namespace std ++__first1; ++__first2; } - return std::copy(__first2, __last2, std::copy(__first1, + return std::copy(__first2, __last2, std::copy(__first1, __last1, __result)); } @@ -4683,7 +4683,7 @@ namespace std * comparison functor. * @param first Start of range. * @param last End of range. - * @param comp + * @param comp * @return False if wrapped to first permutation, true otherwise. * * Treats all permutations of the range [first,last) as a set of @@ -4794,7 +4794,7 @@ namespace std * comparison functor. * @param first Start of range. * @param last End of range. - * @param comp + * @param comp * @return False if wrapped to last permutation, true otherwise. * * Treats all permutations of the range [first,last) as a set of @@ -5023,9 +5023,9 @@ namespace std template<typename _BidirectionalIterator1, typename _BidirectionalIterator2, typename _BinaryPredicate> _BidirectionalIterator1 - __find_end(_BidirectionalIterator1 __first1, + __find_end(_BidirectionalIterator1 __first1, _BidirectionalIterator1 __last1, - _BidirectionalIterator2 __first2, + _BidirectionalIterator2 __first2, _BidirectionalIterator2 __last2, bidirectional_iterator_tag, bidirectional_iterator_tag, _BinaryPredicate __comp) diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h index d1764ac345b..17c3007f1f4 100644 --- a/libstdc++-v3/include/bits/stl_algobase.h +++ b/libstdc++-v3/include/bits/stl_algobase.h @@ -126,7 +126,7 @@ namespace std { // concept requirements __glibcxx_function_requires(_SGIAssignableConcept<_Tp>) - + const _Tp __tmp = __a; __a = __b; __b = __tmp; @@ -169,7 +169,7 @@ namespace std */ template<typename _Tp> inline const _Tp& - max(const _Tp& __a, const _Tp& __b) + max(const _Tp& __a, const _Tp& __b) { // concept requirements __glibcxx_function_requires(_LessThanComparableConcept<_Tp>) @@ -242,7 +242,7 @@ namespace std { typedef typename iterator_traits<_RandomAccessIterator>::difference_type _Distance; - for (_Distance __n = __last - __first; __n > 0; --__n) + for (_Distance __n = __last - __first; __n > 0; --__n) { *__result = *__first; ++__first; @@ -280,7 +280,7 @@ namespace std template<typename _Tp> inline _Tp* - __copy_aux2(const _Tp* __first, const _Tp* __last, _Tp* __result, + __copy_aux2(const _Tp* __first, const _Tp* __last, _Tp* __result, __true_type) { return std::__copy_trivial(__first, __last, __result); } @@ -361,7 +361,7 @@ namespace std template<typename _BidirectionalIterator1, typename _BidirectionalIterator2> inline _BidirectionalIterator2 __copy_backward(_BidirectionalIterator1 __first, - _BidirectionalIterator1 __last, + _BidirectionalIterator1 __last, _BidirectionalIterator2 __result, bidirectional_iterator_tag) { @@ -372,7 +372,7 @@ namespace std template<typename _RandomAccessIterator, typename _BidirectionalIterator> inline _BidirectionalIterator - __copy_backward(_RandomAccessIterator __first, _RandomAccessIterator __last, + __copy_backward(_RandomAccessIterator __first, _RandomAccessIterator __last, _BidirectionalIterator __result, random_access_iterator_tag) { typename iterator_traits<_RandomAccessIterator>::difference_type __n; @@ -382,7 +382,7 @@ namespace std } - // This dispatch class is a workaround for compilers that do not + // This dispatch class is a workaround for compilers that do not // have partial ordering of function templates. All we're doing is // creating a specialization so that we can turn a call to copy_backward // into a memmove whenever possible. @@ -391,9 +391,9 @@ namespace std struct __copy_backward_dispatch { static _BidirectionalIterator2 - copy(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last, + copy(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last, _BidirectionalIterator2 __result) - { return std::__copy_backward(__first, __last, __result, + { return std::__copy_backward(__first, __last, __result, std::__iterator_category(__first)); } }; @@ -427,8 +427,8 @@ namespace std typedef typename __type_traits<typename iterator_traits<_BI2>::value_type> ::has_trivial_assignment_operator _Trivial; return - std::__copy_backward_dispatch<_BI1, _BI2, _Trivial>::copy(__first, - __last, + std::__copy_backward_dispatch<_BI1, _BI2, _Trivial>::copy(__first, + __last, __result); } @@ -754,7 +754,7 @@ namespace std __glibcxx_requires_valid_range(__first1, __last1); __glibcxx_requires_valid_range(__first2, __last2); - for (;__first1 != __last1 && __first2 != __last2; ++__first1, ++__first2) + for (;__first1 != __last1 && __first2 != __last2; ++__first1, ++__first2) { if (*__first1 < *__first2) return true; @@ -790,7 +790,7 @@ namespace std __glibcxx_requires_valid_range(__first2, __last2); for ( ; __first1 != __last1 && __first2 != __last2 - ; ++__first1, ++__first2) + ; ++__first1, ++__first2) { if (__comp(*__first1, *__first2)) return true; @@ -800,10 +800,10 @@ namespace std return __first1 == __last1 && __first2 != __last2; } - inline bool - lexicographical_compare(const unsigned char* __first1, + inline bool + lexicographical_compare(const unsigned char* __first1, const unsigned char* __last1, - const unsigned char* __first2, + const unsigned char* __first2, const unsigned char* __last2) { __glibcxx_requires_valid_range(__first1, __last1); @@ -838,4 +838,4 @@ namespace std } // namespace std -#endif +#endif diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h index c71861378cd..3ed04e5031b 100644 --- a/libstdc++-v3/include/bits/stl_bvector.h +++ b/libstdc++-v3/include/bits/stl_bvector.h @@ -62,45 +62,45 @@ #define _BVECTOR_H 1 namespace __gnu_norm -{ +{ typedef unsigned long _Bit_type; enum { _S_word_bit = int(CHAR_BIT * sizeof(_Bit_type)) }; - struct _Bit_reference + struct _Bit_reference { _Bit_type * _M_p; _Bit_type _M_mask; - _Bit_reference(_Bit_type * __x, _Bit_type __y) + _Bit_reference(_Bit_type * __x, _Bit_type __y) : _M_p(__x), _M_mask(__y) { } _Bit_reference() : _M_p(0), _M_mask(0) { } operator bool() const { return !!(*_M_p & _M_mask); } - _Bit_reference& + _Bit_reference& operator=(bool __x) { - if (__x) + if (__x) *_M_p |= _M_mask; - else + else *_M_p &= ~_M_mask; return *this; } - _Bit_reference& - operator=(const _Bit_reference& __x) + _Bit_reference& + operator=(const _Bit_reference& __x) { return *this = bool(__x); } - bool + bool operator==(const _Bit_reference& __x) const { return bool(*this) == bool(__x); } - bool + bool operator<(const _Bit_reference& __x) const { return !bool(*this) && bool(__x); } - void + void flip() { *_M_p ^= _M_mask; } }; @@ -112,71 +112,71 @@ namespace __gnu_norm _Bit_iterator_base(_Bit_type * __x, unsigned int __y) : _M_p(__x), _M_offset(__y) { } - void - _M_bump_up() + void + _M_bump_up() { - if (_M_offset++ == _S_word_bit - 1) + if (_M_offset++ == _S_word_bit - 1) { _M_offset = 0; ++_M_p; } } - void - _M_bump_down() + void + _M_bump_down() { - if (_M_offset-- == 0) + if (_M_offset-- == 0) { _M_offset = _S_word_bit - 1; --_M_p; } } - - void - _M_incr(ptrdiff_t __i) + + void + _M_incr(ptrdiff_t __i) { difference_type __n = __i + _M_offset; _M_p += __n / _S_word_bit; __n = __n % _S_word_bit; - if (__n < 0) + if (__n < 0) { _M_offset = static_cast<unsigned int>(__n + _S_word_bit); --_M_p; - } + } else _M_offset = static_cast<unsigned int>(__n); } - - bool - operator==(const _Bit_iterator_base& __i) const + + bool + operator==(const _Bit_iterator_base& __i) const { return _M_p == __i._M_p && _M_offset == __i._M_offset; } - - bool - operator<(const _Bit_iterator_base& __i) const + + bool + operator<(const _Bit_iterator_base& __i) const { return _M_p < __i._M_p || (_M_p == __i._M_p && _M_offset < __i._M_offset); } - bool - operator!=(const _Bit_iterator_base& __i) const + bool + operator!=(const _Bit_iterator_base& __i) const { return !(*this == __i); } - - bool - operator>(const _Bit_iterator_base& __i) const + + bool + operator>(const _Bit_iterator_base& __i) const { return __i < *this; } - bool - operator<=(const _Bit_iterator_base& __i) const + bool + operator<=(const _Bit_iterator_base& __i) const { return !(__i < *this); } - bool - operator>=(const _Bit_iterator_base& __i) const + bool + operator>=(const _Bit_iterator_base& __i) const { return !(*this < __i); } }; inline ptrdiff_t - operator-(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y) + operator-(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y) { return _S_word_bit * (__x._M_p - __y._M_p) + __x._M_offset - __y._M_offset; } @@ -188,76 +188,76 @@ namespace __gnu_norm typedef _Bit_iterator iterator; _Bit_iterator() : _Bit_iterator_base(0, 0) { } - _Bit_iterator(_Bit_type * __x, unsigned int __y) + _Bit_iterator(_Bit_type * __x, unsigned int __y) : _Bit_iterator_base(__x, __y) { } - - reference + + reference operator*() const { return reference(_M_p, 1UL << _M_offset); } - iterator& - operator++() + iterator& + operator++() { _M_bump_up(); return *this; } - - iterator - operator++(int) + + iterator + operator++(int) { iterator __tmp = *this; _M_bump_up(); return __tmp; } - iterator& - operator--() + iterator& + operator--() { _M_bump_down(); return *this; } - iterator - operator--(int) + iterator + operator--(int) { iterator __tmp = *this; _M_bump_down(); return __tmp; } - iterator& - operator+=(difference_type __i) + iterator& + operator+=(difference_type __i) { _M_incr(__i); return *this; } iterator& - operator-=(difference_type __i) + operator-=(difference_type __i) { *this += -__i; return *this; } - iterator - operator+(difference_type __i) const + iterator + operator+(difference_type __i) const { iterator __tmp = *this; return __tmp += __i; } - - iterator - operator-(difference_type __i) const + + iterator + operator-(difference_type __i) const { iterator __tmp = *this; return __tmp -= __i; } - - reference + + reference operator[](difference_type __i) { return *(*this + __i); } }; - - inline _Bit_iterator + + inline _Bit_iterator operator+(ptrdiff_t __n, const _Bit_iterator& __x) { return __x + __n; } @@ -267,56 +267,56 @@ namespace __gnu_norm typedef bool const_reference; typedef const bool* pointer; typedef _Bit_const_iterator const_iterator; - + _Bit_const_iterator() : _Bit_iterator_base(0, 0) { } - _Bit_const_iterator(_Bit_type * __x, unsigned int __y) + _Bit_const_iterator(_Bit_type * __x, unsigned int __y) : _Bit_iterator_base(__x, __y) { } - _Bit_const_iterator(const _Bit_iterator& __x) + _Bit_const_iterator(const _Bit_iterator& __x) : _Bit_iterator_base(__x._M_p, __x._M_offset) { } - const_reference - operator*() const + const_reference + operator*() const { return _Bit_reference(_M_p, 1UL << _M_offset); } - - const_iterator& - operator++() + + const_iterator& + operator++() { _M_bump_up(); return *this; } - const_iterator - operator++(int) + const_iterator + operator++(int) { const_iterator __tmp = *this; _M_bump_up(); return __tmp; } - const_iterator& - operator--() + const_iterator& + operator--() { _M_bump_down(); return *this; } - const_iterator - operator--(int) + const_iterator + operator--(int) { const_iterator __tmp = *this; _M_bump_down(); return __tmp; } - const_iterator& - operator+=(difference_type __i) + const_iterator& + operator+=(difference_type __i) { _M_incr(__i); return *this; } - const_iterator& - operator-=(difference_type __i) + const_iterator& + operator-=(difference_type __i) { *this += -__i; return *this; @@ -327,20 +327,20 @@ namespace __gnu_norm return __tmp += __i; } - const_iterator - operator-(difference_type __i) const + const_iterator + operator-(difference_type __i) const { const_iterator __tmp = *this; return __tmp -= __i; } - const_reference - operator[](difference_type __i) + const_reference + operator[](difference_type __i) { return *(*this + __i); } }; - - inline _Bit_const_iterator - operator+(ptrdiff_t __n, const _Bit_const_iterator& __x) + + inline _Bit_const_iterator + operator+(ptrdiff_t __n, const _Bit_const_iterator& __x) { return __x + __n; } template<class _Alloc> @@ -352,30 +352,30 @@ namespace __gnu_norm public: typedef _Alloc allocator_type; - + allocator_type - get_allocator() const + get_allocator() const { return *static_cast<const _Bit_alloc_type*>(this); } - + _Bvector_base(const allocator_type& __a) : _Bit_alloc_type(__a), _M_start(), _M_finish(), _M_end_of_storage(0) { } ~_Bvector_base() { this->_M_deallocate(); } protected: - _Bit_type* - _M_bit_alloc(size_t __n) + _Bit_type* + _M_bit_alloc(size_t __n) { return _Bit_alloc_type::allocate((__n + _S_word_bit - 1) / _S_word_bit); } - void - _M_deallocate() + void + _M_deallocate() { if (_M_start._M_p) - _Bit_alloc_type::deallocate(_M_start._M_p, + _Bit_alloc_type::deallocate(_M_start._M_p, _M_end_of_storage - _M_start._M_p); - } - + } + _Bit_iterator _M_start; _Bit_iterator _M_finish; _Bit_type* _M_end_of_storage; @@ -405,36 +405,36 @@ namespace __gnu_norm * memory and size allocation. Subscripting ( @c [] ) access is * also provided as with C-style arrays. */ -template<typename _Alloc> - class vector<bool, _Alloc> : public _Bvector_base<_Alloc> +template<typename _Alloc> + class vector<bool, _Alloc> : public _Bvector_base<_Alloc> { public: typedef bool value_type; typedef size_t size_type; - typedef ptrdiff_t difference_type; + typedef ptrdiff_t difference_type; typedef _Bit_reference reference; typedef bool const_reference; typedef _Bit_reference* pointer; typedef const bool* const_pointer; - + typedef _Bit_iterator iterator; typedef _Bit_const_iterator const_iterator; - + typedef std::reverse_iterator<const_iterator> const_reverse_iterator; typedef std::reverse_iterator<iterator> reverse_iterator; - + typedef typename _Bvector_base<_Alloc>::allocator_type allocator_type; allocator_type get_allocator() const { return _Bvector_base<_Alloc>::get_allocator(); } - + protected: using _Bvector_base<_Alloc>::_M_bit_alloc; using _Bvector_base<_Alloc>::_M_deallocate; using _Bvector_base<_Alloc>::_M_start; using _Bvector_base<_Alloc>::_M_finish; using _Bvector_base<_Alloc>::_M_end_of_storage; - + protected: void _M_initialize(size_type __n) { @@ -466,7 +466,7 @@ template<typename _Alloc> this->_M_start = iterator(__q, 0); } } - + template<class _InputIterator> void _M_initialize_range(_InputIterator __first, _InputIterator __last, input_iterator_tag) @@ -474,10 +474,10 @@ template<typename _Alloc> this->_M_start = iterator(); this->_M_finish = iterator(); this->_M_end_of_storage = 0; - for ( ; __first != __last; ++__first) + for ( ; __first != __last; ++__first) push_back(*__first); } - + template<class _ForwardIterator> void _M_initialize_range(_ForwardIterator __first, _ForwardIterator __last, forward_iterator_tag) @@ -486,7 +486,7 @@ template<typename _Alloc> _M_initialize(__n); std::copy(__first, __last, this->_M_start); } - + template<class _InputIterator> void _M_insert_range(iterator __pos, _InputIterator __first, _InputIterator __last, @@ -498,7 +498,7 @@ template<typename _Alloc> ++__pos; } } - + template<class _ForwardIterator> void _M_insert_range(iterator __position, _ForwardIterator __first, _ForwardIterator __last, @@ -527,8 +527,8 @@ template<typename _Alloc> this->_M_start = iterator(__q, 0); } } - } - + } + public: iterator begin() { return this->_M_start; } @@ -541,7 +541,7 @@ template<typename _Alloc> const_iterator end() const { return this->_M_finish; } - + reverse_iterator rbegin() { return reverse_iterator(end()); } @@ -553,7 +553,7 @@ template<typename _Alloc> const_reverse_iterator rend() const { return const_reverse_iterator(begin()); } - + size_type size() const { return size_type(end() - begin()); } @@ -565,28 +565,28 @@ template<typename _Alloc> - begin()); } bool empty() const { return begin() == end(); } - + reference operator[](size_type __n) { return *(begin() + difference_type(__n)); } const_reference operator[](size_type __n) const { return *(begin() + difference_type(__n)); } - + void _M_range_check(size_type __n) const { if (__n >= this->size()) __throw_out_of_range(__N("vector<bool>::_M_range_check")); } - + reference at(size_type __n) { _M_range_check(__n); return (*this)[__n]; } const_reference at(size_type __n) const { _M_range_check(__n); return (*this)[__n]; } - + explicit vector(const allocator_type& __a = allocator_type()) : _Bvector_base<_Alloc>(__a) { } - + vector(size_type __n, bool __value, const allocator_type& __a = allocator_type()) : _Bvector_base<_Alloc>(__a) @@ -594,34 +594,34 @@ template<typename _Alloc> _M_initialize(__n); std::fill(this->_M_start._M_p, this->_M_end_of_storage, __value ? ~0 : 0); } - + explicit vector(size_type __n) : _Bvector_base<_Alloc>(allocator_type()) { _M_initialize(__n); std::fill(this->_M_start._M_p, this->_M_end_of_storage, 0); } - + vector(const vector& __x) : _Bvector_base<_Alloc>(__x.get_allocator()) { _M_initialize(__x.size()); std::copy(__x.begin(), __x.end(), this->_M_start); } - + // Check whether it's an integral type. If so, it's not an iterator. - + template<class _Integer> void _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type) { _M_initialize(__n); std::fill(this->_M_start._M_p, this->_M_end_of_storage, __x ? ~0 : 0); } - + template<class _InputIterator> void _M_initialize_dispatch(_InputIterator __first, _InputIterator __last, __false_type) { _M_initialize_range(__first, __last, std::__iterator_category(__first)); } - + template<class _InputIterator> vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a = allocator_type()) @@ -630,9 +630,9 @@ template<typename _Alloc> typedef typename _Is_integer<_InputIterator>::_Integral _Integral; _M_initialize_dispatch(__first, __last, _Integral()); } - + ~vector() { } - + vector& operator=(const vector& __x) { if (&__x == this) @@ -646,12 +646,12 @@ template<typename _Alloc> this->_M_finish = begin() + difference_type(__x.size()); return *this; } - + // assign(), a generalized assignment member function. Two // versions: one that takes a count, and one that takes a range. // The range version is a member template, so we dispatch on whether // or not the type is an integer. - + void _M_fill_assign(size_t __n, bool __x) { if (__n > size()) @@ -665,26 +665,26 @@ template<typename _Alloc> std::fill(this->_M_start._M_p, this->_M_end_of_storage, __x ? ~0 : 0); } } - + void assign(size_t __n, bool __x) { _M_fill_assign(__n, __x); } - + template<class _InputIterator> void assign(_InputIterator __first, _InputIterator __last) { typedef typename _Is_integer<_InputIterator>::_Integral _Integral; _M_assign_dispatch(__first, __last, _Integral()); } - + template<class _Integer> void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type) { _M_fill_assign((size_t) __n, (bool) __val); } - + template<class _InputIterator> void _M_assign_dispatch(_InputIterator __first, _InputIterator __last, __false_type) { _M_assign_aux(__first, __last, std::__iterator_category(__first)); } - + template<class _InputIterator> void _M_assign_aux(_InputIterator __first, _InputIterator __last, input_iterator_tag) @@ -697,7 +697,7 @@ template<typename _Alloc> else insert(end(), __first, __last); } - + template<class _ForwardIterator> void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last, forward_iterator_tag) @@ -712,8 +712,8 @@ template<typename _Alloc> std::copy(__first, __mid, begin()); insert(end(), __mid, __last); } - } - + } + void reserve(size_type __n) { if (__n > this->max_size()) @@ -727,7 +727,7 @@ template<typename _Alloc> this->_M_end_of_storage = __q + (__n + _S_word_bit - 1) / _S_word_bit; } } - + reference front() { return *begin(); } @@ -773,21 +773,21 @@ template<typename _Alloc> _M_insert_aux(__position, __x); return begin() + __n; } - + // Check whether it's an integral type. If so, it's not an iterator. - + template<class _Integer> void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x, __true_type) { _M_fill_insert(__pos, __n, __x); } - + template<class _InputIterator> void _M_insert_dispatch(iterator __pos, _InputIterator __first, _InputIterator __last, __false_type) { _M_insert_range(__pos, __first, __last, std::__iterator_category(__first)); } - + template<class _InputIterator> void insert(iterator __position, _InputIterator __first, _InputIterator __last) @@ -795,7 +795,7 @@ template<typename _Alloc> typedef typename _Is_integer<_InputIterator>::_Integral _Integral; _M_insert_dispatch(__position, __first, __last, _Integral()); } - + void _M_fill_insert(iterator __position, size_type __n, bool __x) { if (__n == 0) @@ -821,10 +821,10 @@ template<typename _Alloc> this->_M_start = iterator(__q, 0); } } - + void insert(iterator __position, size_type __n, bool __x) { _M_fill_insert(__position, __n, __x); } - + void pop_back() { --this->_M_finish; } @@ -844,7 +844,7 @@ template<typename _Alloc> void resize(size_type __new_size, bool __x = bool()) { - if (__new_size < size()) + if (__new_size < size()) erase(begin() + difference_type(__new_size), end()); else insert(end(), __new_size - size(), __x); @@ -856,7 +856,7 @@ template<typename _Alloc> __p != this->_M_end_of_storage; ++__p) *__p = ~*__p; } - + void clear() { erase(begin(), end()); } }; diff --git a/libstdc++-v3/include/bits/stl_construct.h b/libstdc++-v3/include/bits/stl_construct.h index 6db195b29a2..afb33879852 100644 --- a/libstdc++-v3/include/bits/stl_construct.h +++ b/libstdc++-v3/include/bits/stl_construct.h @@ -78,9 +78,9 @@ namespace std { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 402. wrong new expression in [some_]allocator::construct - ::new(static_cast<void*>(__p)) _T1(__value); + ::new(static_cast<void*>(__p)) _T1(__value); } - + /** * @if maint * Constructs an object in existing memory by invoking an allocated @@ -92,7 +92,7 @@ namespace std _Construct(_T1* __p) { // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 402. wrong new expression in [some_]allocator::construct + // 402. wrong new expression in [some_]allocator::construct ::new(static_cast<void*>(__p)) _T1(); } @@ -108,7 +108,7 @@ namespace std /** * @if maint - * Destroy a range of objects with nontrivial destructors. + * Destroy a range of objects with nontrivial destructors. * * This is a helper function used only by _Destroy(). * @endif @@ -128,7 +128,7 @@ namespace std * This is a helper function used only by _Destroy(). * @endif */ - template<typename _ForwardIterator> + template<typename _ForwardIterator> inline void __destroy_aux(_ForwardIterator, _ForwardIterator, __true_type) { } diff --git a/libstdc++-v3/include/bits/stl_deque.h b/libstdc++-v3/include/bits/stl_deque.h index 20e6179efe5..31126775ad0 100644 --- a/libstdc++-v3/include/bits/stl_deque.h +++ b/libstdc++-v3/include/bits/stl_deque.h @@ -66,7 +66,7 @@ #include <bits/stl_iterator_base_funcs.h> namespace __gnu_norm -{ +{ /** * @if maint * @brief This function controls the size of memory nodes. @@ -79,11 +79,11 @@ namespace __gnu_norm * been done since inheriting the SGI code. * @endif */ - inline size_t - __deque_buf_size(size_t __size) + inline size_t + __deque_buf_size(size_t __size) { return __size < 512 ? size_t(512 / __size) : size_t(1); } - - + + /** * @brief A deque::iterator. * @@ -104,7 +104,7 @@ namespace __gnu_norm static size_t _S_buffer_size() { return __deque_buf_size(sizeof(_Tp)); } - + typedef random_access_iterator_tag iterator_category; typedef _Tp value_type; typedef _Ptr pointer; @@ -113,22 +113,22 @@ namespace __gnu_norm typedef ptrdiff_t difference_type; typedef _Tp** _Map_pointer; typedef _Deque_iterator _Self; - + _Tp* _M_cur; _Tp* _M_first; _Tp* _M_last; _Map_pointer _M_node; - - _Deque_iterator(_Tp* __x, _Map_pointer __y) + + _Deque_iterator(_Tp* __x, _Map_pointer __y) : _M_cur(__x), _M_first(*__y), _M_last(*__y + _S_buffer_size()), _M_node(__y) {} _Deque_iterator() : _M_cur(0), _M_first(0), _M_last(0), _M_node(0) {} _Deque_iterator(const iterator& __x) - : _M_cur(__x._M_cur), _M_first(__x._M_first), + : _M_cur(__x._M_cur), _M_first(__x._M_first), _M_last(__x._M_last), _M_node(__x._M_node) {} - + reference operator*() const { return *_M_cur; } @@ -136,7 +136,7 @@ namespace __gnu_norm pointer operator->() const { return _M_cur; } - + _Self& operator++() { @@ -146,7 +146,7 @@ namespace __gnu_norm _M_set_node(_M_node + 1); _M_cur = _M_first; } - return *this; + return *this; } _Self @@ -156,7 +156,7 @@ namespace __gnu_norm ++*this; return __tmp; } - + _Self& operator--() { @@ -168,7 +168,7 @@ namespace __gnu_norm --_M_cur; return *this; } - + _Self operator--(int) { @@ -176,7 +176,7 @@ namespace __gnu_norm --*this; return __tmp; } - + _Self& operator+=(difference_type __n) { @@ -195,29 +195,29 @@ namespace __gnu_norm } return *this; } - + _Self operator+(difference_type __n) const { _Self __tmp = *this; return __tmp += __n; } - + _Self& operator-=(difference_type __n) { return *this += -__n; } - + _Self operator-(difference_type __n) const { _Self __tmp = *this; return __tmp -= __n; } - + reference operator[](difference_type __n) const { return *(*this + __n); } - + /** @if maint * Prepares to traverse new_node. Sets everything except _M_cur, which * should therefore be set by the caller immediately afterwards, based on @@ -232,7 +232,7 @@ namespace __gnu_norm _M_last = _M_first + difference_type(_S_buffer_size()); } }; - + // Note: we also provide overloads whose operands are of the same type in // order to avoid ambiguous overload resolution when std::rel_ops operators // are in scope (for additional details, see libstdc++/3628) @@ -241,34 +241,34 @@ namespace __gnu_norm operator==(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) { return __x._M_cur == __y._M_cur; } - + template<typename _Tp, typename _RefL, typename _PtrL, typename _RefR, typename _PtrR> inline bool operator==(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) { return __x._M_cur == __y._M_cur; } - + template<typename _Tp, typename _Ref, typename _Ptr> inline bool operator!=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) { return !(__x == __y); } - + template<typename _Tp, typename _RefL, typename _PtrL, typename _RefR, typename _PtrR> inline bool operator!=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) { return !(__x == __y); } - + template<typename _Tp, typename _Ref, typename _Ptr> inline bool operator<(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) { return (__x._M_node == __y._M_node) ? (__x._M_cur < __y._M_cur) : (__x._M_node < __y._M_node); } - + template<typename _Tp, typename _RefL, typename _PtrL, typename _RefR, typename _PtrR> inline bool @@ -276,46 +276,46 @@ namespace __gnu_norm const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) { return (__x._M_node == __y._M_node) ? (__x._M_cur < __y._M_cur) : (__x._M_node < __y._M_node); } - + template<typename _Tp, typename _Ref, typename _Ptr> inline bool operator>(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) { return __y < __x; } - + template<typename _Tp, typename _RefL, typename _PtrL, typename _RefR, typename _PtrR> inline bool operator>(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) { return __y < __x; } - + template<typename _Tp, typename _Ref, typename _Ptr> inline bool operator<=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) { return !(__y < __x); } - + template<typename _Tp, typename _RefL, typename _PtrL, typename _RefR, typename _PtrR> inline bool operator<=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) { return !(__y < __x); } - + template<typename _Tp, typename _Ref, typename _Ptr> inline bool operator>=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) { return !(__x < __y); } - + template<typename _Tp, typename _RefL, typename _PtrL, typename _RefR, typename _PtrR> inline bool operator>=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) { return !(__x < __y); } - + // _GLIBCXX_RESOLVE_LIB_DEFECTS // According to the resolution of DR179 not only the various comparison // operators but also operator- must accept mixed iterator/const_iterator @@ -331,12 +331,12 @@ namespace __gnu_norm * (__x._M_node - __y._M_node - 1) + (__x._M_cur - __x._M_first) + (__y._M_last - __y._M_cur); } - + template<typename _Tp, typename _Ref, typename _Ptr> inline _Deque_iterator<_Tp, _Ref, _Ptr> operator+(ptrdiff_t __n, const _Deque_iterator<_Tp, _Ref, _Ptr>& __x) { return __x + __n; } - + /** * @if maint * Deque base class. This class provides the unified face for %deque's @@ -362,15 +362,15 @@ namespace __gnu_norm typedef _Deque_iterator<_Tp,_Tp&,_Tp*> iterator; typedef _Deque_iterator<_Tp,const _Tp&,const _Tp*> const_iterator; - + _Deque_base(const allocator_type& __a, size_t __num_elements) : _Alloc(__a), _M_start(), _M_finish() { _M_initialize_map(__num_elements); } - _Deque_base(const allocator_type& __a) + _Deque_base(const allocator_type& __a) : _Alloc(__a), _M_start(), _M_finish() { } - ~_Deque_base(); + ~_Deque_base(); protected: typedef typename _Alloc::template rebind<_Tp*>::other _Map_alloc_type; @@ -380,31 +380,31 @@ namespace __gnu_norm _Tp* _M_allocate_node() { return _Alloc::allocate(__deque_buf_size(sizeof(_Tp))); } - + void _M_deallocate_node(_Tp* __p) { _Alloc::deallocate(__p, __deque_buf_size(sizeof(_Tp))); } - + _Tp** _M_allocate_map(size_t __n) { return _M_get_map_allocator().allocate(__n); } - + void - _M_deallocate_map(_Tp** __p, size_t __n) + _M_deallocate_map(_Tp** __p, size_t __n) { _M_get_map_allocator().deallocate(__p, __n); } - + protected: void _M_initialize_map(size_t); void _M_create_nodes(_Tp** __nstart, _Tp** __nfinish); void _M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish); enum { _S_initial_map_size = 8 }; - + _Tp** _M_map; size_t _M_map_size; iterator _M_start; iterator _M_finish; }; - + template<typename _Tp, typename _Alloc> _Deque_base<_Tp,_Alloc>::~_Deque_base() { @@ -414,7 +414,7 @@ namespace __gnu_norm _M_deallocate_map(this->_M_map, this->_M_map_size); } } - + /** * @if maint * @brief Layout storage. @@ -430,20 +430,20 @@ namespace __gnu_norm _Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t __num_elements) { size_t __num_nodes = __num_elements / __deque_buf_size(sizeof(_Tp)) + 1; - + this->_M_map_size = std::max((size_t) _S_initial_map_size, __num_nodes + 2); this->_M_map = _M_allocate_map(this->_M_map_size); - + // For "small" maps (needing less than _M_map_size nodes), allocation // starts in the middle elements and grows outwards. So nstart may be // the beginning of _M_map, but for small maps it may be as far in as // _M_map+3. - + _Tp** __nstart = this->_M_map + (this->_M_map_size - __num_nodes) / 2; _Tp** __nfinish = __nstart + __num_nodes; - - try + + try { _M_create_nodes(__nstart, __nfinish); } catch(...) { @@ -452,14 +452,14 @@ namespace __gnu_norm this->_M_map_size = 0; __throw_exception_again; } - + _M_start._M_set_node(__nstart); _M_finish._M_set_node(__nfinish - 1); _M_start._M_cur = _M_start._M_first; _M_finish._M_cur = _M_finish._M_first + __num_elements % __deque_buf_size(sizeof(_Tp)); } - + template<typename _Tp, typename _Alloc> void _Deque_base<_Tp,_Alloc>::_M_create_nodes(_Tp** __nstart, _Tp** __nfinish) @@ -471,12 +471,12 @@ namespace __gnu_norm *__cur = this->_M_allocate_node(); } catch(...) - { + { _M_destroy_nodes(__nstart, __cur); - __throw_exception_again; + __throw_exception_again; } } - + template<typename _Tp, typename _Alloc> void _Deque_base<_Tp,_Alloc>::_M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish) @@ -484,7 +484,7 @@ namespace __gnu_norm for (_Tp** __n = __nstart; __n < __nfinish; ++__n) _M_deallocate_node(*__n); } - + /** * @brief A standard container using fixed-size memory allocation and * constant-time manipulation of elements at either end. @@ -504,15 +504,15 @@ namespace __gnu_norm * * @if maint * Here's how a deque<Tp> manages memory. Each deque has 4 members: - * + * * - Tp** _M_map * - size_t _M_map_size * - iterator _M_start, _M_finish - * + * * map_size is at least 8. %map is an array of map_size pointers-to-"nodes". * (The name %map has nothing to do with the std::map class, and "nodes" * should not be confused with std::list's usage of "node".) - * + * * A "node" has no specific type name as such, but it is referred to as * "node" in this file. It is a simple array-of-Tp. If Tp is very large, * there will be one Tp element per node (i.e., an "array" of one). @@ -520,11 +520,11 @@ namespace __gnu_norm * larger the Tp, the fewer Tp's will fit in a node. The goal here is to * keep the total size of a node relatively small and constant over different * Tp's, to improve allocator efficiency. - * + * * **** As I write this, the nodes are /not/ allocated using the high-speed * memory pool. There are 20 hours left in the year; perhaps I can fix * this before 2002. - * + * * Not every pointer in the %map array will point to a node. If the initial * number of elements in the deque is small, the /middle/ %map pointers will * be valid, and the ones at the edges will be unused. This same situation @@ -552,9 +552,9 @@ namespace __gnu_norm * that range are uninitialized storage. Otherwise, [start.cur, start.last) * and [finish.first, finish.cur) are initialized objects, and [start.first, * start.cur) and [finish.cur, finish.last) are uninitialized storage. - * - [%map, %map + map_size) is a valid, non-empty range. - * - [start.node, finish.node] is a valid range contained within - * [%map, %map + map_size). + * - [%map, %map + map_size) is a valid, non-empty range. + * - [start.node, finish.node] is a valid range contained within + * [%map, %map + map_size). * - A pointer in the range [%map, %map + map_size) points to an allocated * node if and only if the pointer is in the range * [start.node, finish.node]. @@ -574,9 +574,9 @@ namespace __gnu_norm { // concept requirements __glibcxx_class_requires(_Tp, _SGIAssignableConcept) - + typedef _Deque_base<_Tp, _Alloc> _Base; - + public: typedef _Tp value_type; typedef value_type* pointer; @@ -590,13 +590,13 @@ namespace __gnu_norm typedef size_t size_type; typedef ptrdiff_t difference_type; typedef typename _Base::allocator_type allocator_type; - + protected: typedef pointer* _Map_pointer; - + static size_t _S_buffer_size() { return __deque_buf_size(sizeof(_Tp)); } - + // Functions controlling memory layout, and nothing else. using _Base::_M_initialize_map; using _Base::_M_create_nodes; @@ -605,7 +605,7 @@ namespace __gnu_norm using _Base::_M_deallocate_node; using _Base::_M_allocate_map; using _Base::_M_deallocate_map; - + /** @if maint * A total of four data members accumulated down the heirarchy. * @endif @@ -614,7 +614,7 @@ namespace __gnu_norm using _Base::_M_map_size; using _Base::_M_start; using _Base::_M_finish; - + public: // [23.2.1.1] construct/copy/destroy // (assign() and get_allocator() are also listed in this section) @@ -622,25 +622,25 @@ namespace __gnu_norm * @brief Default constructor creates no elements. */ explicit - deque(const allocator_type& __a = allocator_type()) + deque(const allocator_type& __a = allocator_type()) : _Base(__a, 0) {} - + /** * @brief Create a %deque with copies of an exemplar element. * @param n The number of elements to initially create. * @param value An element to copy. - * + * * This constructor fills the %deque with @a n copies of @a value. */ deque(size_type __n, const value_type& __value, const allocator_type& __a = allocator_type()) : _Base(__a, __n) { _M_fill_initialize(__value); } - + /** * @brief Create a %deque with default elements. * @param n The number of elements to initially create. - * + * * This constructor fills the %deque with @a n copies of a * default-constructed element. */ @@ -648,23 +648,23 @@ namespace __gnu_norm deque(size_type __n) : _Base(allocator_type(), __n) { _M_fill_initialize(value_type()); } - + /** * @brief %Deque copy constructor. * @param x A %deque of identical element and allocator types. - * + * * The newly-created %deque uses a copy of the allocation object used * by @a x. */ deque(const deque& __x) - : _Base(__x.get_allocator(), __x.size()) + : _Base(__x.get_allocator(), __x.size()) { std::uninitialized_copy(__x.begin(), __x.end(), this->_M_start); } - + /** * @brief Builds a %deque from a range. * @param first An input iterator. * @param last An input iterator. - * + * * Create a %deque consisting of copies of the elements from [first, * last). * @@ -683,7 +683,7 @@ namespace __gnu_norm typedef typename _Is_integer<_InputIterator>::_Integral _Integral; _M_initialize_dispatch(__first, __last, _Integral()); } - + /** * The dtor only erases the elements, and note that if the elements * themselves are pointers, the pointed-to memory is not touched in any @@ -691,17 +691,17 @@ namespace __gnu_norm */ ~deque() { std::_Destroy(this->_M_start, this->_M_finish); } - + /** * @brief %Deque assignment operator. * @param x A %deque of identical element and allocator types. - * + * * All the elements of @a x are copied, but unlike the copy constructor, * the allocator object is not copied. */ deque& operator=(const deque& __x); - + /** * @brief Assigns a given value to a %deque. * @param n Number of elements to be assigned. @@ -715,7 +715,7 @@ namespace __gnu_norm void assign(size_type __n, const value_type& __val) { _M_fill_assign(__n, __val); } - + /** * @brief Assigns a range to a %deque. * @param first An input iterator. @@ -735,12 +735,12 @@ namespace __gnu_norm typedef typename _Is_integer<_InputIterator>::_Integral _Integral; _M_assign_dispatch(__first, __last, _Integral()); } - + /// Get a copy of the memory allocation object. allocator_type get_allocator() const { return _Base::get_allocator(); } - + // iterators /** * Returns a read/write iterator that points to the first element in the @@ -749,7 +749,7 @@ namespace __gnu_norm iterator begin() { return this->_M_start; } - + /** * Returns a read-only (constant) iterator that points to the first * element in the %deque. Iteration is done in ordinary element order. @@ -757,7 +757,7 @@ namespace __gnu_norm const_iterator begin() const { return this->_M_start; } - + /** * Returns a read/write iterator that points one past the last element in * the %deque. Iteration is done in ordinary element order. @@ -765,7 +765,7 @@ namespace __gnu_norm iterator end() { return this->_M_finish; } - + /** * Returns a read-only (constant) iterator that points one past the last * element in the %deque. Iteration is done in ordinary element order. @@ -773,7 +773,7 @@ namespace __gnu_norm const_iterator end() const { return this->_M_finish; } - + /** * Returns a read/write reverse iterator that points to the last element * in the %deque. Iteration is done in reverse element order. @@ -781,7 +781,7 @@ namespace __gnu_norm reverse_iterator rbegin() { return reverse_iterator(this->_M_finish); } - + /** * Returns a read-only (constant) reverse iterator that points to the * last element in the %deque. Iteration is done in reverse element @@ -790,7 +790,7 @@ namespace __gnu_norm const_reverse_iterator rbegin() const { return const_reverse_iterator(this->_M_finish); } - + /** * Returns a read/write reverse iterator that points to one before the * first element in the %deque. Iteration is done in reverse element @@ -798,7 +798,7 @@ namespace __gnu_norm */ reverse_iterator rend() { return reverse_iterator(this->_M_start); } - + /** * Returns a read-only (constant) reverse iterator that points to one * before the first element in the %deque. Iteration is done in reverse @@ -807,18 +807,18 @@ namespace __gnu_norm const_reverse_iterator rend() const { return const_reverse_iterator(this->_M_start); } - + // [23.2.1.2] capacity /** Returns the number of elements in the %deque. */ size_type size() const { return this->_M_finish - this->_M_start; } - + /** Returns the size() of the largest possible %deque. */ size_type max_size() const { return size_type(-1); } - + /** * @brief Resizes the %deque to the specified number of elements. * @param new_size Number of elements the %deque should contain. @@ -833,12 +833,12 @@ namespace __gnu_norm resize(size_type __new_size, const value_type& __x) { const size_type __len = size(); - if (__new_size < __len) + if (__new_size < __len) erase(this->_M_start + __new_size, this->_M_finish); else insert(this->_M_finish, __new_size - __len, __x); } - + /** * @brief Resizes the %deque to the specified number of elements. * @param new_size Number of elements the %deque should contain. @@ -851,14 +851,14 @@ namespace __gnu_norm void resize(size_type new_size) { resize(new_size, value_type()); } - + /** * Returns true if the %deque is empty. (Thus begin() would equal end().) */ bool empty() const { return this->_M_finish == this->_M_start; } - + // element access /** * @brief Subscript access to the data contained in the %deque. @@ -872,7 +872,7 @@ namespace __gnu_norm reference operator[](size_type __n) { return this->_M_start[difference_type(__n)]; } - + /** * @brief Subscript access to the data contained in the %deque. * @param n The index of the element for which data should be accessed. @@ -885,7 +885,7 @@ namespace __gnu_norm const_reference operator[](size_type __n) const { return this->_M_start[difference_type(__n)]; } - + protected: /// @if maint Safety check used only from at(). @endif void @@ -894,7 +894,7 @@ namespace __gnu_norm if (__n >= this->size()) __throw_out_of_range(__N("deque::_M_range_check")); } - + public: /** * @brief Provides access to the data contained in the %deque. @@ -909,7 +909,7 @@ namespace __gnu_norm reference at(size_type __n) { _M_range_check(__n); return (*this)[__n]; } - + /** * @brief Provides access to the data contained in the %deque. * @param n The index of the element for which data should be accessed. @@ -926,7 +926,7 @@ namespace __gnu_norm _M_range_check(__n); return (*this)[__n]; } - + /** * Returns a read/write reference to the data at the first element of the * %deque. @@ -934,7 +934,7 @@ namespace __gnu_norm reference front() { return *this->_M_start; } - + /** * Returns a read-only (constant) reference to the data at the first * element of the %deque. @@ -942,7 +942,7 @@ namespace __gnu_norm const_reference front() const { return *this->_M_start; } - + /** * Returns a read/write reference to the data at the last element of the * %deque. @@ -954,7 +954,7 @@ namespace __gnu_norm --__tmp; return *__tmp; } - + /** * Returns a read-only (constant) reference to the data at the last * element of the %deque. @@ -966,7 +966,7 @@ namespace __gnu_norm --__tmp; return *__tmp; } - + // [23.2.1.2] modifiers /** * @brief Add data to the front of the %deque. @@ -977,7 +977,7 @@ namespace __gnu_norm * nature of a %deque this operation can be done in constant time. */ void - push_front(const value_type& __x) + push_front(const value_type& __x) { if (this->_M_start._M_cur != this->_M_start._M_first) { @@ -987,7 +987,7 @@ namespace __gnu_norm else _M_push_front_aux(__x); } - + /** * @brief Add data to the end of the %deque. * @param x Data to be added. @@ -1007,7 +1007,7 @@ namespace __gnu_norm else _M_push_back_aux(__x); } - + /** * @brief Removes first element. * @@ -1024,10 +1024,10 @@ namespace __gnu_norm std::_Destroy(this->_M_start._M_cur); ++this->_M_start._M_cur; } - else + else _M_pop_front_aux(); } - + /** * @brief Removes last element. * @@ -1047,7 +1047,7 @@ namespace __gnu_norm else _M_pop_back_aux(); } - + /** * @brief Inserts given value into %deque before specified iterator. * @param position An iterator into the %deque. @@ -1059,7 +1059,7 @@ namespace __gnu_norm */ iterator insert(iterator position, const value_type& __x); - + /** * @brief Inserts a number of copies of given data into the %deque. * @param position An iterator into the %deque. @@ -1072,7 +1072,7 @@ namespace __gnu_norm void insert(iterator __position, size_type __n, const value_type& __x) { _M_fill_insert(__position, __n, __x); } - + /** * @brief Inserts a range into the %deque. * @param position An iterator into the %deque. @@ -1092,7 +1092,7 @@ namespace __gnu_norm typedef typename _Is_integer<_InputIterator>::_Integral _Integral; _M_insert_dispatch(__position, __first, __last, _Integral()); } - + /** * @brief Remove element at given position. * @param position Iterator pointing to element to be erased. @@ -1108,7 +1108,7 @@ namespace __gnu_norm */ iterator erase(iterator __position); - + /** * @brief Remove a range of elements. * @param first Iterator pointing to the first element to be erased. @@ -1127,7 +1127,7 @@ namespace __gnu_norm */ iterator erase(iterator __first, iterator __last); - + /** * @brief Swaps data with another %deque. * @param x A %deque of the same element and allocator types. @@ -1145,18 +1145,18 @@ namespace __gnu_norm std::swap(this->_M_map, __x._M_map); std::swap(this->_M_map_size, __x._M_map_size); } - + /** * Erases all the elements. Note that this function only erases the * elements, and that if the elements themselves are pointers, the * pointed-to memory is not touched in any way. Managing the pointer is * the user's responsibilty. */ - void clear(); - + void clear(); + protected: // Internal constructor functions follow. - + // called by the range constructor to implement [23.1.1]/9 template<typename _Integer> void @@ -1165,7 +1165,7 @@ namespace __gnu_norm _M_initialize_map(__n); _M_fill_initialize(__x); } - + // called by the range constructor to implement [23.1.1]/9 template<typename _InputIterator> void @@ -1176,7 +1176,7 @@ namespace __gnu_norm _IterCategory; _M_range_initialize(__first, __last, _IterCategory()); } - + // called by the second initialize_dispatch above //@{ /** @@ -1192,17 +1192,17 @@ namespace __gnu_norm * @endif */ template<typename _InputIterator> - void + void _M_range_initialize(_InputIterator __first, _InputIterator __last, input_iterator_tag); - + // called by the second initialize_dispatch above template<typename _ForwardIterator> - void + void _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last, forward_iterator_tag); //@} - + /** * @if maint * @brief Fills the %deque with copies of value. @@ -1217,10 +1217,10 @@ namespace __gnu_norm */ void _M_fill_initialize(const value_type& __value); - + // Internal assign functions follow. The *_aux functions do the actual // assignment work for the range versions. - + // called by the range assign to implement [23.1.1]/9 template<typename _Integer> void @@ -1229,7 +1229,7 @@ namespace __gnu_norm _M_fill_assign(static_cast<size_type>(__n), static_cast<value_type>(__val)); } - + // called by the range assign to implement [23.1.1]/9 template<typename _InputIterator> void @@ -1240,13 +1240,13 @@ namespace __gnu_norm _IterCategory; _M_assign_aux(__first, __last, _IterCategory()); } - + // called by the second assign_dispatch above template<typename _InputIterator> void _M_assign_aux(_InputIterator __first, _InputIterator __last, input_iterator_tag); - + // called by the second assign_dispatch above template<typename _ForwardIterator> void @@ -1264,7 +1264,7 @@ namespace __gnu_norm else erase(std::copy(__first, __last, begin()), end()); } - + // Called by assign(n,t), and the range assign when it turns out to be the // same thing. void @@ -1281,7 +1281,7 @@ namespace __gnu_norm std::fill(begin(), end(), __val); } } - + //@{ /** * @if maint @@ -1293,10 +1293,10 @@ namespace __gnu_norm void _M_pop_back_aux(); void _M_pop_front_aux(); //@} - + // Internal insert functions follow. The *_aux functions do the actual // insertion work when all shortcuts fail. - + // called by the range insert to implement [23.1.1]/9 template<typename _Integer> void @@ -1306,7 +1306,7 @@ namespace __gnu_norm _M_fill_insert(__pos, static_cast<size_type>(__n), static_cast<value_type>(__x)); } - + // called by the range insert to implement [23.1.1]/9 template<typename _InputIterator> void @@ -1318,40 +1318,40 @@ namespace __gnu_norm _IterCategory; _M_range_insert_aux(__pos, __first, __last, _IterCategory()); } - + // called by the second insert_dispatch above template<typename _InputIterator> void _M_range_insert_aux(iterator __pos, _InputIterator __first, _InputIterator __last, input_iterator_tag); - + // called by the second insert_dispatch above template<typename _ForwardIterator> void _M_range_insert_aux(iterator __pos, _ForwardIterator __first, _ForwardIterator __last, forward_iterator_tag); - + // Called by insert(p,n,x), and the range insert when it turns out to be // the same thing. Can use fill functions in optimal situations, // otherwise passes off to insert_aux(p,n,x). void - _M_fill_insert(iterator __pos, size_type __n, const value_type& __x); - + _M_fill_insert(iterator __pos, size_type __n, const value_type& __x); + // called by insert(p,x) iterator _M_insert_aux(iterator __pos, const value_type& __x); - + // called by insert(p,n,x) via fill_insert void _M_insert_aux(iterator __pos, size_type __n, const value_type& __x); - + // called by range_insert_aux for forward iterators template<typename _ForwardIterator> void - _M_insert_aux(iterator __pos, + _M_insert_aux(iterator __pos, _ForwardIterator __first, _ForwardIterator __last, size_type __n); - + //@{ /** * @if maint @@ -1368,7 +1368,7 @@ namespace __gnu_norm _M_new_elements_at_front(__n - __vacancies); return this->_M_start - difference_type(__n); } - + iterator _M_reserve_elements_at_back(size_type __n) { @@ -1378,15 +1378,15 @@ namespace __gnu_norm _M_new_elements_at_back(__n - __vacancies); return this->_M_finish + difference_type(__n); } - + void _M_new_elements_at_front(size_type __new_elements); - + void _M_new_elements_at_back(size_type __new_elements); //@} - - + + //@{ /** * @if maint @@ -1404,20 +1404,20 @@ namespace __gnu_norm - (this->_M_finish._M_node - this->_M_map)) _M_reallocate_map(__nodes_to_add, false); } - + void _M_reserve_map_at_front (size_type __nodes_to_add = 1) { if (__nodes_to_add > size_type(this->_M_start._M_node - this->_M_map)) _M_reallocate_map(__nodes_to_add, true); } - + void _M_reallocate_map(size_type __nodes_to_add, bool __add_at_front); //@} }; - - + + /** * @brief Deque equality comparison. * @param x A %deque. @@ -1434,7 +1434,7 @@ namespace __gnu_norm const deque<_Tp, _Alloc>& __y) { return __x.size() == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin()); } - + /** * @brief Deque ordering relation. * @param x A %deque. @@ -1450,42 +1450,42 @@ namespace __gnu_norm inline bool operator<(const deque<_Tp, _Alloc>& __x, const deque<_Tp, _Alloc>& __y) - { return lexicographical_compare(__x.begin(), __x.end(), + { return lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end()); } - + /// Based on operator== template<typename _Tp, typename _Alloc> inline bool operator!=(const deque<_Tp, _Alloc>& __x, const deque<_Tp, _Alloc>& __y) { return !(__x == __y); } - + /// Based on operator< template<typename _Tp, typename _Alloc> inline bool operator>(const deque<_Tp, _Alloc>& __x, const deque<_Tp, _Alloc>& __y) { return __y < __x; } - + /// Based on operator< template<typename _Tp, typename _Alloc> inline bool operator<=(const deque<_Tp, _Alloc>& __x, const deque<_Tp, _Alloc>& __y) { return !(__y < __x); } - + /// Based on operator< template<typename _Tp, typename _Alloc> inline bool operator>=(const deque<_Tp, _Alloc>& __x, const deque<_Tp, _Alloc>& __y) { return !(__x < __y); } - + /// See std::deque::swap(). template<typename _Tp, typename _Alloc> inline void swap(deque<_Tp,_Alloc>& __x, deque<_Tp,_Alloc>& __y) { __x.swap(__y); } } // namespace __gnu_norm - + #endif /* _DEQUE_H */ diff --git a/libstdc++-v3/include/bits/stl_function.h b/libstdc++-v3/include/bits/stl_function.h index df7aeed1210..74ddcce9d8b 100644 --- a/libstdc++-v3/include/bits/stl_function.h +++ b/libstdc++-v3/include/bits/stl_function.h @@ -118,7 +118,7 @@ namespace std typedef _Arg2 second_argument_type; ///< the type of the second argument typedef _Result result_type; ///< type of the return type - }; + }; /** @} */ // 20.3.2 arithmetic @@ -132,7 +132,7 @@ namespace std /// One of the @link s20_3_2_arithmetic math functors@endlink. template <class _Tp> struct plus : public binary_function<_Tp, _Tp, _Tp> - { + { _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x + __y; } @@ -193,7 +193,7 @@ namespace std */ /// One of the @link s20_3_3_comparisons comparison functors@endlink. template <class _Tp> - struct equal_to : public binary_function<_Tp, _Tp, bool> + struct equal_to : public binary_function<_Tp, _Tp, bool> { bool operator()(const _Tp& __x, const _Tp& __y) const @@ -202,7 +202,7 @@ namespace std /// One of the @link s20_3_3_comparisons comparison functors@endlink. template <class _Tp> - struct not_equal_to : public binary_function<_Tp, _Tp, bool> + struct not_equal_to : public binary_function<_Tp, _Tp, bool> { bool operator()(const _Tp& __x, const _Tp& __y) const @@ -245,7 +245,7 @@ namespace std { return __x <= __y; } }; /** @} */ - + // 20.3.4 logical operations /** @defgroup s20_3_4_logical Boolean Operations Classes * Here are wrapper functors for Boolean operations: @c &&, @c ||, and @c !. @@ -295,7 +295,7 @@ namespace std * { * bool operator() (int x) { return x > 3; } * }; - * + * * std::find_if (v.begin(), v.end(), not1(IntGreaterThanThree())); * \endcode * The call to @c find_if will locate the first index (i) of @c v for which @@ -317,7 +317,7 @@ namespace std public: explicit unary_negate(const _Predicate& __x) : _M_pred(__x) {} - + bool operator()(const typename _Predicate::argument_type& __x) const { return !_M_pred(__x); } @@ -325,13 +325,13 @@ namespace std /// One of the @link s20_3_5_negators negation functors@endlink. template <class _Predicate> - inline unary_negate<_Predicate> + inline unary_negate<_Predicate> not1(const _Predicate& __pred) { return unary_negate<_Predicate>(__pred); } /// One of the @link s20_3_5_negators negation functors@endlink. - template <class _Predicate> - class binary_negate + template <class _Predicate> + class binary_negate : public binary_function<typename _Predicate::first_argument_type, typename _Predicate::second_argument_type, bool> @@ -344,18 +344,18 @@ namespace std : _M_pred(__x) { } bool - operator()(const typename _Predicate::first_argument_type& __x, + operator()(const typename _Predicate::first_argument_type& __x, const typename _Predicate::second_argument_type& __y) const { return !_M_pred(__x, __y); } }; /// One of the @link s20_3_5_negators negation functors@endlink. template <class _Predicate> - inline binary_negate<_Predicate> + inline binary_negate<_Predicate> not2(const _Predicate& __pred) { return binary_negate<_Predicate>(__pred); } /** @} */ - + // 20.3.6 binders /** @defgroup s20_3_6_binder Binder Classes * Binders turn functions/functors with two arguments into functors with @@ -388,7 +388,7 @@ namespace std * @{ */ /// One of the @link s20_3_6_binder binder functors@endlink. - template <class _Operation> + template <class _Operation> class binder1st : public unary_function<typename _Operation::second_argument_type, typename _Operation::result_type> @@ -404,7 +404,7 @@ namespace std typename _Operation::result_type operator()(const typename _Operation::second_argument_type& __x) const { return op(value, __x); } - + // _GLIBCXX_RESOLVE_LIB_DEFECTS // 109. Missing binders for non-const sequence elements typename _Operation::result_type @@ -414,15 +414,15 @@ namespace std /// One of the @link s20_3_6_binder binder functors@endlink. template <class _Operation, class _Tp> - inline binder1st<_Operation> - bind1st(const _Operation& __fn, const _Tp& __x) + inline binder1st<_Operation> + bind1st(const _Operation& __fn, const _Tp& __x) { typedef typename _Operation::first_argument_type _Arg1_type; return binder1st<_Operation>(__fn, _Arg1_type(__x)); } /// One of the @link s20_3_6_binder binder functors@endlink. - template <class _Operation> + template <class _Operation> class binder2nd : public unary_function<typename _Operation::first_argument_type, typename _Operation::result_type> @@ -432,13 +432,13 @@ namespace std typename _Operation::second_argument_type value; public: binder2nd(const _Operation& __x, - const typename _Operation::second_argument_type& __y) + const typename _Operation::second_argument_type& __y) : op(__x), value(__y) {} typename _Operation::result_type operator()(const typename _Operation::first_argument_type& __x) const { return op(__x, value); } - + // _GLIBCXX_RESOLVE_LIB_DEFECTS // 109. Missing binders for non-const sequence elements typename _Operation::result_type @@ -448,14 +448,14 @@ namespace std /// One of the @link s20_3_6_binder binder functors@endlink. template <class _Operation, class _Tp> - inline binder2nd<_Operation> - bind2nd(const _Operation& __fn, const _Tp& __x) + inline binder2nd<_Operation> + bind2nd(const _Operation& __fn, const _Tp& __x) { typedef typename _Operation::second_argument_type _Arg2_type; return binder2nd<_Operation>(__fn, _Arg2_type(__x)); } /** @} */ - + // 20.3.7 adaptors pointers functions /** @defgroup s20_3_7_adaptors Adaptors for pointers to functions * The advantage of function objects over pointers to functions is that @@ -484,7 +484,7 @@ namespace std _Result (*_M_ptr)(_Arg); public: pointer_to_unary_function() {} - + explicit pointer_to_unary_function(_Result (*__x)(_Arg)) : _M_ptr(__x) {} @@ -511,7 +511,7 @@ namespace std pointer_to_binary_function() {} explicit - pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2)) + pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2)) : _M_ptr(__x) {} _Result @@ -521,18 +521,18 @@ namespace std /// One of the @link s20_3_7_adaptors adaptors for function pointers@endlink. template <class _Arg1, class _Arg2, class _Result> - inline pointer_to_binary_function<_Arg1, _Arg2, _Result> + inline pointer_to_binary_function<_Arg1, _Arg2, _Result> ptr_fun(_Result (*__x)(_Arg1, _Arg2)) { return pointer_to_binary_function<_Arg1, _Arg2, _Result>(__x); } /** @} */ - + template <class _Tp> struct _Identity : public unary_function<_Tp,_Tp> { _Tp& operator()(_Tp& __x) const { return __x; } - + const _Tp& operator()(const _Tp& __x) const { return __x; } @@ -545,7 +545,7 @@ namespace std typename _Pair::first_type& operator()(_Pair& __x) const { return __x.first; } - + const typename _Pair::first_type& operator()(const _Pair& __x) const { return __x.first; } @@ -558,7 +558,7 @@ namespace std typename _Pair::second_type& operator()(_Pair& __x) const { return __x.second; } - + const typename _Pair::second_type& operator()(const _Pair& __x) const { return __x.second; } @@ -633,7 +633,7 @@ namespace std private: _Ret (_Tp::*_M_f)(); }; - + /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink. template <class _Ret, class _Tp> class const_mem_fun_ref_t : public unary_function<_Tp, _Ret> @@ -656,7 +656,7 @@ namespace std { public: explicit - mem_fun1_t(_Ret (_Tp::*__pf)(_Arg)) + mem_fun1_t(_Ret (_Tp::*__pf)(_Arg)) : _M_f(__pf) {} _Ret @@ -713,7 +713,7 @@ namespace std private: _Ret (_Tp::*_M_f)(_Arg) const; }; - + /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink. template <class _Tp> class mem_fun_t<void, _Tp> : public unary_function<_Tp*, void> @@ -729,7 +729,7 @@ namespace std private: void (_Tp::*_M_f)(); }; - + /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink. template <class _Tp> class const_mem_fun_t<void, _Tp> : public unary_function<const _Tp*, void> @@ -745,7 +745,7 @@ namespace std private: void (_Tp::*_M_f)() const; }; - + /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink. template <class _Tp> class mem_fun_ref_t<void, _Tp> : public unary_function<_Tp, void> @@ -777,7 +777,7 @@ namespace std private: void (_Tp::*_M_f)() const; }; - + /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink. template <class _Tp, class _Arg> class mem_fun1_t<void, _Tp, _Arg> : public binary_function<_Tp*, _Arg, void> @@ -786,7 +786,7 @@ namespace std explicit mem_fun1_t(void (_Tp::*__pf)(_Arg)) : _M_f(__pf) {} - + void operator()(_Tp* __p, _Arg __x) const { (__p->*_M_f)(__x); } @@ -796,21 +796,21 @@ namespace std /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink. template <class _Tp, class _Arg> - class const_mem_fun1_t<void, _Tp, _Arg> + class const_mem_fun1_t<void, _Tp, _Arg> : public binary_function<const _Tp*, _Arg, void> { public: explicit const_mem_fun1_t(void (_Tp::*__pf)(_Arg) const) : _M_f(__pf) {} - + void operator()(const _Tp* __p, _Arg __x) const { (__p->*_M_f)(__x); } private: void (_Tp::*_M_f)(_Arg) const; }; - + /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink. template <class _Tp, class _Arg> class mem_fun1_ref_t<void, _Tp, _Arg> @@ -856,10 +856,10 @@ namespace std inline const_mem_fun_t<_Ret, _Tp> mem_fun(_Ret (_Tp::*__f)() const) { return const_mem_fun_t<_Ret, _Tp>(__f); } - + template <class _Ret, class _Tp> inline mem_fun_ref_t<_Ret, _Tp> - mem_fun_ref(_Ret (_Tp::*__f)()) + mem_fun_ref(_Ret (_Tp::*__f)()) { return mem_fun_ref_t<_Ret, _Tp>(__f); } template <class _Ret, class _Tp> @@ -888,7 +888,7 @@ namespace std { return const_mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); } /** @} */ - + } // namespace std #endif /* _FUNCTION_H */ diff --git a/libstdc++-v3/include/bits/stl_heap.h b/libstdc++-v3/include/bits/stl_heap.h index 97311ed7161..eff7fd351d7 100644 --- a/libstdc++-v3/include/bits/stl_heap.h +++ b/libstdc++-v3/include/bits/stl_heap.h @@ -74,7 +74,7 @@ namespace std _Distance __parent = 0; for (_Distance __child = 1; __child < __n; ++__child) { - if (__first[__parent] < __first[__child]) + if (__first[__parent] < __first[__child]) return false; if ((__child & 1) == 0) ++__parent; @@ -113,7 +113,7 @@ namespace std // Heap-manipulation functions: push_heap, pop_heap, make_heap, sort_heap. template<typename _RandomAccessIterator, typename _Distance, typename _Tp> - void + void __push_heap(_RandomAccessIterator __first, _Distance __holeIndex, _Distance __topIndex, _Tp __value) { @@ -137,7 +137,7 @@ namespace std * range [first,last-1). After completion, [first,last) is a valid heap. */ template<typename _RandomAccessIterator> - inline void + inline void push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) { typedef typename iterator_traits<_RandomAccessIterator>::value_type @@ -156,7 +156,7 @@ namespace std _DistanceType(0), _ValueType(*(__last - 1))); } - template<typename _RandomAccessIterator, typename _Distance, typename _Tp, + template<typename _RandomAccessIterator, typename _Distance, typename _Tp, typename _Compare> void __push_heap(_RandomAccessIterator __first, _Distance __holeIndex, @@ -185,7 +185,7 @@ namespace std * Compare operations are performed using comp. */ template<typename _RandomAccessIterator, typename _Compare> - inline void + inline void push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { @@ -205,7 +205,7 @@ namespace std } template<typename _RandomAccessIterator, typename _Distance, typename _Tp> - void + void __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex, _Distance __len, _Tp __value) { @@ -228,7 +228,7 @@ namespace std } template<typename _RandomAccessIterator, typename _Tp> - inline void + inline void __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _RandomAccessIterator __result, _Tp __value) { @@ -292,7 +292,7 @@ namespace std } template<typename _RandomAccessIterator, typename _Tp, typename _Compare> - inline void + inline void __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _RandomAccessIterator __result, _Tp __value, _Compare __comp) { @@ -315,7 +315,7 @@ namespace std * made using comp. */ template<typename _RandomAccessIterator, typename _Compare> - inline void + inline void pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { @@ -340,7 +340,7 @@ namespace std * This operation makes the elements in [first,last) into a heap. */ template<typename _RandomAccessIterator> - void + void make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) { typedef typename iterator_traits<_RandomAccessIterator>::value_type @@ -357,7 +357,7 @@ namespace std if (__last - __first < 2) return; - const _DistanceType __len = __last - __first; + const _DistanceType __len = __last - __first; _DistanceType __parent = (__len - 2) / 2; while (true) { @@ -380,7 +380,7 @@ namespace std * Comparisons are made using comp. */ template<typename _RandomAccessIterator, typename _Compare> - inline void + inline void make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { @@ -393,7 +393,7 @@ namespace std __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< _RandomAccessIterator>) __glibcxx_requires_valid_range(__first, __last); - + if (__last - __first < 2) return; @@ -444,7 +444,7 @@ namespace std * Comparisons are made using comp. */ template<typename _RandomAccessIterator, typename _Compare> - void + void sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { diff --git a/libstdc++-v3/include/bits/stl_iterator.h b/libstdc++-v3/include/bits/stl_iterator.h index ce1e1ed00dd..cc564314bc8 100644 --- a/libstdc++-v3/include/bits/stl_iterator.h +++ b/libstdc++-v3/include/bits/stl_iterator.h @@ -87,7 +87,7 @@ namespace std * the requirement that the iterators must be safe. */ template<typename _Iterator> - class reverse_iterator + class reverse_iterator : public iterator<typename iterator_traits<_Iterator>::iterator_category, typename iterator_traits<_Iterator>::value_type, typename iterator_traits<_Iterator>::difference_type, @@ -98,9 +98,9 @@ namespace std _Iterator current; public: - typedef _Iterator iterator_type; - typedef typename iterator_traits<_Iterator>::difference_type - difference_type; + typedef _Iterator iterator_type; + typedef typename iterator_traits<_Iterator>::difference_type + difference_type; typedef typename iterator_traits<_Iterator>::reference reference; typedef typename iterator_traits<_Iterator>::pointer pointer; @@ -116,13 +116,13 @@ namespace std /** * This %iterator will move in the opposite direction that @p x does. */ - explicit + explicit reverse_iterator(iterator_type __x) : current(__x) { } /** * The copy constructor is normal. */ - reverse_iterator(const reverse_iterator& __x) + reverse_iterator(const reverse_iterator& __x) : current(__x.current) { } /** @@ -132,11 +132,11 @@ namespace std template<typename _Iter> reverse_iterator(const reverse_iterator<_Iter>& __x) : current(__x.base()) { } - + /** * @return @c current, the %iterator used for underlying work. */ - iterator_type + iterator_type base() const { return current; } @@ -145,8 +145,8 @@ namespace std * * @doctodo */ - reference - operator*() const + reference + operator*() const { _Iterator __tmp = current; return *--__tmp; @@ -157,7 +157,7 @@ namespace std * * @doctodo */ - pointer + pointer operator->() const { return &(operator*()); } @@ -166,8 +166,8 @@ namespace std * * @doctodo */ - reverse_iterator& - operator++() + reverse_iterator& + operator++() { --current; return *this; @@ -178,8 +178,8 @@ namespace std * * @doctodo */ - reverse_iterator - operator++(int) + reverse_iterator + operator++(int) { reverse_iterator __tmp = *this; --current; @@ -191,8 +191,8 @@ namespace std * * @doctodo */ - reverse_iterator& - operator--() + reverse_iterator& + operator--() { ++current; return *this; @@ -203,20 +203,20 @@ namespace std * * @doctodo */ - reverse_iterator operator--(int) + reverse_iterator operator--(int) { reverse_iterator __tmp = *this; ++current; return __tmp; } - + /** * @return TODO * * @doctodo */ - reverse_iterator - operator+(difference_type __n) const + reverse_iterator + operator+(difference_type __n) const { return reverse_iterator(current - __n); } /** @@ -224,8 +224,8 @@ namespace std * * @doctodo */ - reverse_iterator& - operator+=(difference_type __n) + reverse_iterator& + operator+=(difference_type __n) { current -= __n; return *this; @@ -236,8 +236,8 @@ namespace std * * @doctodo */ - reverse_iterator - operator-(difference_type __n) const + reverse_iterator + operator-(difference_type __n) const { return reverse_iterator(current + __n); } /** @@ -245,8 +245,8 @@ namespace std * * @doctodo */ - reverse_iterator& - operator-=(difference_type __n) + reverse_iterator& + operator-=(difference_type __n) { current += __n; return *this; @@ -257,11 +257,11 @@ namespace std * * @doctodo */ - reference + reference operator[](difference_type __n) const - { return *(*this + __n); } - }; - + { return *(*this + __n); } + }; + //@{ /** * @param x A %reverse_iterator. @@ -273,51 +273,51 @@ namespace std * */ template<typename _Iterator> - inline bool - operator==(const reverse_iterator<_Iterator>& __x, - const reverse_iterator<_Iterator>& __y) + inline bool + operator==(const reverse_iterator<_Iterator>& __x, + const reverse_iterator<_Iterator>& __y) { return __x.base() == __y.base(); } template<typename _Iterator> - inline bool - operator<(const reverse_iterator<_Iterator>& __x, - const reverse_iterator<_Iterator>& __y) + inline bool + operator<(const reverse_iterator<_Iterator>& __x, + const reverse_iterator<_Iterator>& __y) { return __y.base() < __x.base(); } template<typename _Iterator> - inline bool - operator!=(const reverse_iterator<_Iterator>& __x, - const reverse_iterator<_Iterator>& __y) + inline bool + operator!=(const reverse_iterator<_Iterator>& __x, + const reverse_iterator<_Iterator>& __y) { return !(__x == __y); } template<typename _Iterator> - inline bool - operator>(const reverse_iterator<_Iterator>& __x, - const reverse_iterator<_Iterator>& __y) + inline bool + operator>(const reverse_iterator<_Iterator>& __x, + const reverse_iterator<_Iterator>& __y) { return __y < __x; } template<typename _Iterator> - inline bool - operator<=(const reverse_iterator<_Iterator>& __x, - const reverse_iterator<_Iterator>& __y) + inline bool + operator<=(const reverse_iterator<_Iterator>& __x, + const reverse_iterator<_Iterator>& __y) { return !(__y < __x); } template<typename _Iterator> - inline bool - operator>=(const reverse_iterator<_Iterator>& __x, - const reverse_iterator<_Iterator>& __y) + inline bool + operator>=(const reverse_iterator<_Iterator>& __x, + const reverse_iterator<_Iterator>& __y) { return !(__x < __y); } template<typename _Iterator> inline typename reverse_iterator<_Iterator>::difference_type - operator-(const reverse_iterator<_Iterator>& __x, - const reverse_iterator<_Iterator>& __y) + operator-(const reverse_iterator<_Iterator>& __x, + const reverse_iterator<_Iterator>& __y) { return __y.base() - __x.base(); } template<typename _Iterator> - inline reverse_iterator<_Iterator> + inline reverse_iterator<_Iterator> operator+(typename reverse_iterator<_Iterator>::difference_type __n, - const reverse_iterator<_Iterator>& __x) + const reverse_iterator<_Iterator>& __x) { return reverse_iterator<_Iterator>(__x.base() - __n); } //@} @@ -333,7 +333,7 @@ namespace std * save typing. */ template<typename _Container> - class back_insert_iterator + class back_insert_iterator : public iterator<output_iterator_tag, void, void, void, void> { protected: @@ -342,9 +342,9 @@ namespace std public: /// A nested typedef for the type of whatever container you used. typedef _Container container_type; - + /// The only way to create this %iterator is with a container. - explicit + explicit back_insert_iterator(_Container& __x) : container(&__x) { } /** @@ -359,19 +359,19 @@ namespace std * always append the value to the end of the container. */ back_insert_iterator& - operator=(typename _Container::const_reference __value) - { + operator=(typename _Container::const_reference __value) + { container->push_back(__value); return *this; } /// Simply returns *this. - back_insert_iterator& + back_insert_iterator& operator*() { return *this; } /// Simply returns *this. (This %iterator does not "move".) - back_insert_iterator& + back_insert_iterator& operator++() { return *this; } @@ -393,8 +393,8 @@ namespace std * types for you. */ template<typename _Container> - inline back_insert_iterator<_Container> - back_inserter(_Container& __x) + inline back_insert_iterator<_Container> + back_inserter(_Container& __x) { return back_insert_iterator<_Container>(__x); } /** @@ -408,7 +408,7 @@ namespace std * save typing. */ template<typename _Container> - class front_insert_iterator + class front_insert_iterator : public iterator<output_iterator_tag, void, void, void, void> { protected: @@ -433,24 +433,24 @@ namespace std * always prepend the value to the front of the container. */ front_insert_iterator& - operator=(typename _Container::const_reference __value) - { + operator=(typename _Container::const_reference __value) + { container->push_front(__value); return *this; } /// Simply returns *this. - front_insert_iterator& + front_insert_iterator& operator*() { return *this; } /// Simply returns *this. (This %iterator does not "move".) - front_insert_iterator& + front_insert_iterator& operator++() { return *this; } /// Simply returns *this. (This %iterator does not "move".) - front_insert_iterator + front_insert_iterator operator++(int) { return *this; } }; @@ -467,8 +467,8 @@ namespace std * types for you. */ template<typename _Container> - inline front_insert_iterator<_Container> - front_inserter(_Container& __x) + inline front_insert_iterator<_Container> + front_inserter(_Container& __x) { return front_insert_iterator<_Container>(__x); } /** @@ -486,7 +486,7 @@ namespace std * save typing. */ template<typename _Container> - class insert_iterator + class insert_iterator : public iterator<output_iterator_tag, void, void, void, void> { protected: @@ -496,14 +496,14 @@ namespace std public: /// A nested typedef for the type of whatever container you used. typedef _Container container_type; - + /** * The only way to create this %iterator is with a container and an * initial position (a normal %iterator into the container). */ - insert_iterator(_Container& __x, typename _Container::iterator __i) + insert_iterator(_Container& __x, typename _Container::iterator __i) : container(&__x), iter(__i) {} - + /** * @param value An instance of whatever type * container_type::const_reference is; presumably a @@ -528,29 +528,29 @@ namespace std * @endcode */ insert_iterator& - operator=(const typename _Container::const_reference __value) - { + operator=(const typename _Container::const_reference __value) + { iter = container->insert(iter, __value); ++iter; return *this; } /// Simply returns *this. - insert_iterator& + insert_iterator& operator*() { return *this; } /// Simply returns *this. (This %iterator does not "move".) - insert_iterator& + insert_iterator& operator++() { return *this; } /// Simply returns *this. (This %iterator does not "move".) - insert_iterator& + insert_iterator& operator++(int) { return *this; } }; - + /** * @param x A container of arbitrary type. * @return An instance of insert_iterator working on @p x. @@ -563,16 +563,16 @@ namespace std * types for you. */ template<typename _Container, typename _Iterator> - inline insert_iterator<_Container> + inline insert_iterator<_Container> inserter(_Container& __x, _Iterator __i) { - return insert_iterator<_Container>(__x, + return insert_iterator<_Container>(__x, typename _Container::iterator(__i)); } } // namespace std namespace __gnu_cxx -{ +{ // This iterator adapter is 'normal' in the sense that it does not // change the semantics of any of the operators of its iterator // parameter. Its primary purpose is to convert an iterator that is @@ -587,19 +587,19 @@ namespace __gnu_cxx { protected: _Iterator _M_current; - + public: typedef typename iterator_traits<_Iterator>::iterator_category iterator_category; typedef typename iterator_traits<_Iterator>::value_type value_type; - typedef typename iterator_traits<_Iterator>::difference_type + typedef typename iterator_traits<_Iterator>::difference_type difference_type; typedef typename iterator_traits<_Iterator>::reference reference; typedef typename iterator_traits<_Iterator>::pointer pointer; __normal_iterator() : _M_current(_Iterator()) { } - explicit + explicit __normal_iterator(const _Iterator& __i) : _M_current(__i) { } // Allow iterator to const_iterator conversion @@ -612,22 +612,22 @@ namespace __gnu_cxx reference operator*() const { return *_M_current; } - + pointer operator->() const { return _M_current; } - + __normal_iterator& operator++() { ++_M_current; return *this; } - + __normal_iterator operator++(int) { return __normal_iterator(_M_current++); } - + // Bidirectional iterator requirements __normal_iterator& operator--() @@ -635,16 +635,16 @@ namespace __gnu_cxx --_M_current; return *this; } - + __normal_iterator operator--(int) { return __normal_iterator(_M_current--); } - + // Random access iterator requirements reference operator[](const difference_type& __n) const { return _M_current[__n]; } - + __normal_iterator& operator+=(const difference_type& __n) { _M_current += __n; return *this; } @@ -652,16 +652,16 @@ namespace __gnu_cxx __normal_iterator operator+(const difference_type& __n) const { return __normal_iterator(_M_current + __n); } - + __normal_iterator& operator-=(const difference_type& __n) { _M_current -= __n; return *this; } - + __normal_iterator operator-(const difference_type& __n) const { return __normal_iterator(_M_current - __n); } - - const _Iterator& + + const _Iterator& base() const { return _M_current; } }; @@ -673,7 +673,7 @@ namespace __gnu_cxx // will make overload resolution ambiguous (when in scope) if we don't // provide overloads whose operands are of the same type. Can someone // remind me what generic programming is about? -- Gaby - + // Forward iterator requirements template<typename _IteratorL, typename _IteratorR, typename _Container> inline bool @@ -701,7 +701,7 @@ namespace __gnu_cxx // Random access iterator requirements template<typename _IteratorL, typename _IteratorR, typename _Container> - inline bool + inline bool operator<(const __normal_iterator<_IteratorL, _Container>& __lhs, const __normal_iterator<_IteratorR, _Container>& __rhs) { return __lhs.base() < __rhs.base(); } @@ -765,7 +765,7 @@ namespace __gnu_cxx { return __normal_iterator<_Iterator, _Container>(__i.base() + __n); } } // namespace __gnu_cxx -#endif +#endif // Local Variables: // mode:C++ diff --git a/libstdc++-v3/include/bits/stl_iterator_base_funcs.h b/libstdc++-v3/include/bits/stl_iterator_base_funcs.h index b7626d9355b..c514e81a089 100644 --- a/libstdc++-v3/include/bits/stl_iterator_base_funcs.h +++ b/libstdc++-v3/include/bits/stl_iterator_base_funcs.h @@ -76,7 +76,7 @@ namespace std { // concept requirements __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) - + typename iterator_traits<_InputIterator>::difference_type __n = 0; while (__first != __last) { @@ -85,7 +85,7 @@ namespace std } return __n; } - + template<typename _RandomAccessIterator> inline typename iterator_traits<_RandomAccessIterator>::difference_type __distance(_RandomAccessIterator __first, _RandomAccessIterator __last, @@ -96,7 +96,7 @@ namespace std _RandomAccessIterator>) return __last - __first; } - + /** * @brief A generalization of pointer arithmetic. * @param first An input iterator. @@ -117,7 +117,7 @@ namespace std return std::__distance(__first, __last, std::__iterator_category(__first)); } - + template<typename _InputIterator, typename _Distance> inline void __advance(_InputIterator& __i, _Distance __n, input_iterator_tag) @@ -127,7 +127,7 @@ namespace std while (__n--) ++__i; } - + template<typename _BidirectionalIterator, typename _Distance> inline void __advance(_BidirectionalIterator& __i, _Distance __n, @@ -143,7 +143,7 @@ namespace std while (__n++) --__i; } - + template<typename _RandomAccessIterator, typename _Distance> inline void __advance(_RandomAccessIterator& __i, _Distance __n, @@ -154,7 +154,7 @@ namespace std _RandomAccessIterator>) __i += __n; } - + /** * @brief A generalization of pointer arithmetic. * @param i An input iterator. diff --git a/libstdc++-v3/include/bits/stl_list.h b/libstdc++-v3/include/bits/stl_list.h index 2c6504a710a..15f73914a2d 100644 --- a/libstdc++-v3/include/bits/stl_list.h +++ b/libstdc++-v3/include/bits/stl_list.h @@ -69,7 +69,7 @@ namespace __gnu_norm // latter publicly inherits from the former in an effort to reduce code // duplication. This results in some "needless" static_cast'ing later on, // but it's all safe downcasting. - + /// @if maint Common part of a node in the %list. @endif struct _List_node_base { @@ -88,18 +88,18 @@ namespace __gnu_norm void hook(_List_node_base * const __position); - + void unhook(); }; - + /// @if maint An actual node in the %list. @endif template<typename _Tp> struct _List_node : public _List_node_base { _Tp _M_data; ///< User's data. }; - + /** * @brief A list::iterator. * @@ -112,13 +112,13 @@ namespace __gnu_norm { typedef _List_iterator<_Tp> _Self; typedef _List_node<_Tp> _Node; - + typedef ptrdiff_t difference_type; typedef bidirectional_iterator_tag iterator_category; typedef _Tp value_type; typedef _Tp* pointer; typedef _Tp& reference; - + _List_iterator() { } _List_iterator(_List_node_base* __x) @@ -132,14 +132,14 @@ namespace __gnu_norm pointer operator->() const { return &static_cast<_Node*>(_M_node)->_M_data; } - + _Self& operator++() { _M_node = _M_node->_M_next; return *this; } - + _Self operator++(int) { @@ -147,14 +147,14 @@ namespace __gnu_norm _M_node = _M_node->_M_next; return __tmp; } - + _Self& operator--() { _M_node = _M_node->_M_prev; return *this; } - + _Self operator--(int) { @@ -162,7 +162,7 @@ namespace __gnu_norm _M_node = _M_node->_M_prev; return __tmp; } - + bool operator==(const _Self& __x) const { return _M_node == __x._M_node; } @@ -170,11 +170,11 @@ namespace __gnu_norm bool operator!=(const _Self& __x) const { return _M_node != __x._M_node; } - + // The only member points to the %list element. _List_node_base* _M_node; }; - + /** * @brief A list::const_iterator. * @@ -188,13 +188,13 @@ namespace __gnu_norm typedef _List_const_iterator<_Tp> _Self; typedef const _List_node<_Tp> _Node; typedef _List_iterator<_Tp> iterator; - + typedef ptrdiff_t difference_type; typedef bidirectional_iterator_tag iterator_category; typedef _Tp value_type; typedef const _Tp* pointer; typedef const _Tp& reference; - + _List_const_iterator() { } _List_const_iterator(const _List_node_base* __x) @@ -212,14 +212,14 @@ namespace __gnu_norm pointer operator->() const { return &static_cast<_Node*>(_M_node)->_M_data; } - + _Self& operator++() { _M_node = _M_node->_M_next; return *this; } - + _Self operator++(int) { @@ -227,14 +227,14 @@ namespace __gnu_norm _M_node = _M_node->_M_next; return __tmp; } - + _Self& operator--() { _M_node = _M_node->_M_prev; return *this; } - + _Self operator--(int) { @@ -242,32 +242,32 @@ namespace __gnu_norm _M_node = _M_node->_M_prev; return __tmp; } - + bool operator==(const _Self& __x) const { return _M_node == __x._M_node; } - + bool operator!=(const _Self& __x) const { return _M_node != __x._M_node; } - + // The only member points to the %list element. const _List_node_base* _M_node; }; - + template<typename _Val> - inline bool - operator==(const _List_iterator<_Val>& __x, - const _List_const_iterator<_Val>& __y) + inline bool + operator==(const _List_iterator<_Val>& __x, + const _List_const_iterator<_Val>& __y) { return __x._M_node == __y._M_node; } template<typename _Val> - inline bool + inline bool operator!=(const _List_iterator<_Val>& __x, - const _List_const_iterator<_Val>& __y) + const _List_const_iterator<_Val>& __y) { return __x._M_node != __y._M_node; } - + /** * @if maint * See bits/stl_deque.h's _Deque_base for an explanation. @@ -300,7 +300,7 @@ namespace __gnu_norm _List_node<_Tp>* _M_get_node() { return _Node_Alloc_type::allocate(1); } - + void _M_put_node(_List_node<_Tp>* __p) { _Node_Alloc_type::deallocate(__p, 1); } @@ -308,18 +308,18 @@ namespace __gnu_norm public: typedef _Alloc allocator_type; - allocator_type + allocator_type get_allocator() const { return allocator_type(*static_cast<const _Node_Alloc_type*>(this)); } _List_base(const allocator_type& __a) : _Node_Alloc_type(__a) { _M_init(); } - + // This is what actually destroys the list. ~_List_base() { _M_clear(); } - + void _M_clear(); @@ -330,7 +330,7 @@ namespace __gnu_norm this->_M_node._M_prev = &this->_M_node; } }; - + /** * @brief A standard container with linear time access to elements, * and fixed time insertion/deletion at any point in the sequence. @@ -381,9 +381,9 @@ namespace __gnu_norm { // concept requirements __glibcxx_class_requires(_Tp, _SGIAssignableConcept) - + typedef _List_base<_Tp, _Alloc> _Base; - + public: typedef _Tp value_type; typedef value_type* pointer; @@ -397,12 +397,12 @@ namespace __gnu_norm typedef size_t size_type; typedef ptrdiff_t difference_type; typedef typename _Base::allocator_type allocator_type; - + protected: // Note that pointers-to-_Node's can be ctor-converted to // iterator types. - typedef _List_node<_Tp> _Node; - + typedef _List_node<_Tp> _Node; + /** @if maint * One data member plus two memory-handling functions. If the * _Alloc type requires separate instances, then one of those @@ -412,7 +412,7 @@ namespace __gnu_norm using _Base::_M_node; using _Base::_M_put_node; using _Base::_M_get_node; - + /** * @if maint * @param x An instance of user data. @@ -424,7 +424,7 @@ namespace __gnu_norm _M_create_node(const value_type& __x) { _Node* __p = this->_M_get_node(); - try + try { std::_Construct(&__p->_M_data, __x); } @@ -435,7 +435,7 @@ namespace __gnu_norm } return __p; } - + /** * @if maint * Allocates space for a new node and default-constructs a new @@ -446,7 +446,7 @@ namespace __gnu_norm _M_create_node() { _Node* __p = this->_M_get_node(); - try + try { std::_Construct(&__p->_M_data); } @@ -457,7 +457,7 @@ namespace __gnu_norm } return __p; } - + public: // [23.2.2.1] construct/copy/destroy // (assign() and get_allocator() are also listed in this section) @@ -467,23 +467,23 @@ namespace __gnu_norm explicit list(const allocator_type& __a = allocator_type()) : _Base(__a) { } - + /** * @brief Create a %list with copies of an exemplar element. * @param n The number of elements to initially create. * @param value An element to copy. - * + * * This constructor fills the %list with @a n copies of @a value. */ list(size_type __n, const value_type& __value, const allocator_type& __a = allocator_type()) : _Base(__a) { this->insert(begin(), __n, __value); } - + /** * @brief Create a %list with default elements. * @param n The number of elements to initially create. - * + * * This constructor fills the %list with @a n copies of a * default-constructed element. */ @@ -491,23 +491,23 @@ namespace __gnu_norm list(size_type __n) : _Base(allocator_type()) { this->insert(begin(), __n, value_type()); } - + /** * @brief %List copy constructor. * @param x A %list of identical element and allocator types. - * + * * The newly-created %list uses a copy of the allocation object used * by @a x. */ list(const list& __x) : _Base(__x.get_allocator()) { this->insert(begin(), __x.begin(), __x.end()); } - + /** * @brief Builds a %list from a range. * @param first An input iterator. * @param last An input iterator. - * + * * Create a %list consisting of copies of the elements from * [@a first,@a last). This is linear in N (where N is * distance(@a first,@a last)). @@ -522,7 +522,7 @@ namespace __gnu_norm const allocator_type& __a = allocator_type()) : _Base(__a) { this->insert(begin(), __first, __last); } - + /** * No explicit dtor needed as the _Base dtor takes care of * things. The _Base dtor only erases the elements, and note @@ -530,17 +530,17 @@ namespace __gnu_norm * memory is not touched in any way. Managing the pointer is * the user's responsibilty. */ - + /** * @brief %List assignment operator. * @param x A %list of identical element and allocator types. - * + * * All the elements of @a x are copied, but unlike the copy * constructor, the allocator object is not copied. */ list& operator=(const list& __x); - + /** * @brief Assigns a given value to a %list. * @param n Number of elements to be assigned. @@ -552,9 +552,9 @@ namespace __gnu_norm * of elements assigned. Old data may be lost. */ void - assign(size_type __n, const value_type& __val) + assign(size_type __n, const value_type& __val) { _M_fill_assign(__n, __val); } - + /** * @brief Assigns a range to a %list. * @param first An input iterator. @@ -570,17 +570,17 @@ namespace __gnu_norm template<typename _InputIterator> void assign(_InputIterator __first, _InputIterator __last) - { + { // Check whether it's an integral type. If so, it's not an iterator. typedef typename _Is_integer<_InputIterator>::_Integral _Integral; _M_assign_dispatch(__first, __last, _Integral()); } - + /// Get a copy of the memory allocation object. allocator_type get_allocator() const { return _Base::get_allocator(); } - + // iterators /** * Returns a read/write iterator that points to the first element in the @@ -589,7 +589,7 @@ namespace __gnu_norm iterator begin() { return this->_M_node._M_next; } - + /** * Returns a read-only (constant) iterator that points to the * first element in the %list. Iteration is done in ordinary @@ -598,7 +598,7 @@ namespace __gnu_norm const_iterator begin() const { return this->_M_node._M_next; } - + /** * Returns a read/write iterator that points one past the last * element in the %list. Iteration is done in ordinary element @@ -606,7 +606,7 @@ namespace __gnu_norm */ iterator end() { return &this->_M_node; } - + /** * Returns a read-only (constant) iterator that points one past * the last element in the %list. Iteration is done in ordinary @@ -615,7 +615,7 @@ namespace __gnu_norm const_iterator end() const { return &this->_M_node; } - + /** * Returns a read/write reverse iterator that points to the last * element in the %list. Iteration is done in reverse element @@ -624,7 +624,7 @@ namespace __gnu_norm reverse_iterator rbegin() { return reverse_iterator(end()); } - + /** * Returns a read-only (constant) reverse iterator that points to * the last element in the %list. Iteration is done in reverse @@ -633,7 +633,7 @@ namespace __gnu_norm const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); } - + /** * Returns a read/write reverse iterator that points to one * before the first element in the %list. Iteration is done in @@ -642,7 +642,7 @@ namespace __gnu_norm reverse_iterator rend() { return reverse_iterator(begin()); } - + /** * Returns a read-only (constant) reverse iterator that points to one * before the first element in the %list. Iteration is done in reverse @@ -651,7 +651,7 @@ namespace __gnu_norm const_reverse_iterator rend() const { return const_reverse_iterator(begin()); } - + // [23.2.2.2] capacity /** * Returns true if the %list is empty. (Thus begin() would equal @@ -660,17 +660,17 @@ namespace __gnu_norm bool empty() const { return this->_M_node._M_next == &this->_M_node; } - + /** Returns the number of elements in the %list. */ size_type size() const { return std::distance(begin(), end()); } - + /** Returns the size() of the largest possible %list. */ size_type max_size() const { return size_type(-1); } - + /** * @brief Resizes the %list to the specified number of elements. * @param new_size Number of elements the %list should contain. @@ -683,7 +683,7 @@ namespace __gnu_norm */ void resize(size_type __new_size, const value_type& __x); - + /** * @brief Resizes the %list to the specified number of elements. * @param new_size Number of elements the %list should contain. @@ -696,7 +696,7 @@ namespace __gnu_norm void resize(size_type __new_size) { this->resize(__new_size, value_type()); } - + // element access /** * Returns a read/write reference to the data at the first @@ -705,7 +705,7 @@ namespace __gnu_norm reference front() { return *begin(); } - + /** * Returns a read-only (constant) reference to the data at the first * element of the %list. @@ -713,7 +713,7 @@ namespace __gnu_norm const_reference front() const { return *begin(); } - + /** * Returns a read/write reference to the data at the last element * of the %list. @@ -721,7 +721,7 @@ namespace __gnu_norm reference back() { return *(--end()); } - + /** * Returns a read-only (constant) reference to the data at the last * element of the %list. @@ -729,7 +729,7 @@ namespace __gnu_norm const_reference back() const { return *(--end()); } - + // [23.2.2.3] modifiers /** * @brief Add data to the front of the %list. @@ -744,7 +744,7 @@ namespace __gnu_norm void push_front(const value_type& __x) { this->_M_insert(begin(), __x); } - + /** * @brief Removes first element. * @@ -760,7 +760,7 @@ namespace __gnu_norm void pop_front() { this->_M_erase(begin()); } - + /** * @brief Add data to the end of the %list. * @param x Data to be added. @@ -774,7 +774,7 @@ namespace __gnu_norm void push_back(const value_type& __x) { this->_M_insert(end(), __x); } - + /** * @brief Removes last element. * @@ -789,7 +789,7 @@ namespace __gnu_norm void pop_back() { this->_M_erase(this->_M_node._M_prev); } - + /** * @brief Inserts given value into %list before specified iterator. * @param position An iterator into the %list. @@ -803,7 +803,7 @@ namespace __gnu_norm */ iterator insert(iterator __position, const value_type& __x); - + /** * @brief Inserts a number of copies of given data into the %list. * @param position An iterator into the %list. @@ -820,7 +820,7 @@ namespace __gnu_norm void insert(iterator __position, size_type __n, const value_type& __x) { _M_fill_insert(__position, __n, __x); } - + /** * @brief Inserts a range into the %list. * @param position An iterator into the %list. @@ -837,14 +837,14 @@ namespace __gnu_norm */ template<typename _InputIterator> void - insert(iterator __position, _InputIterator __first, + insert(iterator __position, _InputIterator __first, _InputIterator __last) { // Check whether it's an integral type. If so, it's not an iterator. typedef typename _Is_integer<_InputIterator>::_Integral _Integral; _M_insert_dispatch(__position, __first, __last, _Integral()); } - + /** * @brief Remove element at given position. * @param position Iterator pointing to element to be erased. @@ -862,7 +862,7 @@ namespace __gnu_norm */ iterator erase(iterator __position); - + /** * @brief Remove a range of elements. * @param first Iterator pointing to the first element to be erased. @@ -889,7 +889,7 @@ namespace __gnu_norm __first = erase(__first); return __last; } - + /** * @brief Swaps data with another %list. * @param x A %list of the same element and allocator types. @@ -902,7 +902,7 @@ namespace __gnu_norm void swap(list& __x) { _List_node_base::swap(this->_M_node,__x._M_node); } - + /** * Erases all the elements. Note that this function only erases * the elements, and that if the elements themselves are @@ -915,7 +915,7 @@ namespace __gnu_norm _Base::_M_clear(); _Base::_M_init(); } - + // [23.2.2.4] list operations /** * @brief Insert contents of another %list. @@ -932,7 +932,7 @@ namespace __gnu_norm if (!__x.empty()) this->_M_transfer(__position, __x.begin(), __x.end()); } - + /** * @brief Insert element from another %list. * @param position Iterator referencing the element to insert before. @@ -951,7 +951,7 @@ namespace __gnu_norm return; this->_M_transfer(__position, __i, __j); } - + /** * @brief Insert range from another %list. * @param position Iterator referencing the element to insert before. @@ -970,7 +970,7 @@ namespace __gnu_norm if (__first != __last) this->_M_transfer(__position, __first, __last); } - + /** * @brief Remove all elements equal to value. * @param value The value to remove. @@ -984,7 +984,7 @@ namespace __gnu_norm */ void remove(const _Tp& __value); - + /** * @brief Remove all elements satisfying a predicate. * @param Predicate Unary predicate function or object. @@ -999,7 +999,7 @@ namespace __gnu_norm template<typename _Predicate> void remove_if(_Predicate); - + /** * @brief Remove consecutive duplicate elements. * @@ -1012,7 +1012,7 @@ namespace __gnu_norm */ void unique(); - + /** * @brief Remove consecutive elements satisfying a predicate. * @param BinaryPredicate Binary predicate function or object. @@ -1028,7 +1028,7 @@ namespace __gnu_norm template<typename _BinaryPredicate> void unique(_BinaryPredicate); - + /** * @brief Merge sorted lists. * @param x Sorted list to merge. @@ -1040,7 +1040,7 @@ namespace __gnu_norm */ void merge(list& __x); - + /** * @brief Merge sorted lists according to comparison function. * @param x Sorted list to merge. @@ -1056,7 +1056,7 @@ namespace __gnu_norm template<typename _StrictWeakOrdering> void merge(list&, _StrictWeakOrdering); - + /** * @brief Reverse the elements in list. * @@ -1065,7 +1065,7 @@ namespace __gnu_norm void reverse() { this->_M_node.reverse(); } - + /** * @brief Sort the elements. * @@ -1074,7 +1074,7 @@ namespace __gnu_norm */ void sort(); - + /** * @brief Sort the elements according to comparison function. * @@ -1084,10 +1084,10 @@ namespace __gnu_norm template<typename _StrictWeakOrdering> void sort(_StrictWeakOrdering); - + protected: // Internal assign functions follow. - + // Called by the range assign to implement [23.1.1]/9 template<typename _Integer> void @@ -1096,21 +1096,21 @@ namespace __gnu_norm _M_fill_assign(static_cast<size_type>(__n), static_cast<value_type>(__val)); } - + // Called by the range assign to implement [23.1.1]/9 template<typename _InputIterator> void - _M_assign_dispatch(_InputIterator __first, _InputIterator __last, + _M_assign_dispatch(_InputIterator __first, _InputIterator __last, __false_type); - + // Called by assign(n,t), and the range assign when it turns out // to be the same thing. void _M_fill_assign(size_type __n, const value_type& __val); - - + + // Internal insert functions follow. - + // Called by the range insert to implement [23.1.1]/9 template<typename _Integer> void @@ -1120,7 +1120,7 @@ namespace __gnu_norm _M_fill_insert(__pos, static_cast<size_type>(__n), static_cast<value_type>(__x)); } - + // Called by the range insert to implement [23.1.1]/9 template<typename _InputIterator> void @@ -1131,7 +1131,7 @@ namespace __gnu_norm for ( ; __first != __last; ++__first) _M_insert(__pos, *__first); } - + // Called by insert(p,n,x), and the range insert when it turns out // to be the same thing. void @@ -1140,8 +1140,8 @@ namespace __gnu_norm for ( ; __n > 0; --__n) _M_insert(__pos, __x); } - - + + // Moves the elements from [first,last) before position. void _M_transfer(iterator __position, iterator __first, iterator __last) @@ -1165,7 +1165,7 @@ namespace __gnu_norm _M_put_node(__n); } }; - + /** * @brief List equality comparison. * @param x A %list. @@ -1183,17 +1183,17 @@ namespace __gnu_norm typedef typename list<_Tp,_Alloc>::const_iterator const_iterator; const_iterator __end1 = __x.end(); const_iterator __end2 = __y.end(); - + const_iterator __i1 = __x.begin(); const_iterator __i2 = __y.begin(); - while (__i1 != __end1 && __i2 != __end2 && *__i1 == *__i2) + while (__i1 != __end1 && __i2 != __end2 && *__i1 == *__i2) { ++__i1; ++__i2; } return __i1 == __end1 && __i2 == __end2; } - + /** * @brief List ordering relation. * @param x A %list. @@ -1210,31 +1210,31 @@ namespace __gnu_norm operator<(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y) { return std::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end()); } - + /// Based on operator== template<typename _Tp, typename _Alloc> inline bool operator!=(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y) { return !(__x == __y); } - + /// Based on operator< template<typename _Tp, typename _Alloc> inline bool operator>(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y) { return __y < __x; } - + /// Based on operator< template<typename _Tp, typename _Alloc> inline bool operator<=(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y) { return !(__y < __x); } - + /// Based on operator< template<typename _Tp, typename _Alloc> inline bool operator>=(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y) { return !(__x < __y); } - + /// See std::list::swap(). template<typename _Tp, typename _Alloc> inline void diff --git a/libstdc++-v3/include/bits/stl_map.h b/libstdc++-v3/include/bits/stl_map.h index 04876ba7c99..3a563f174be 100644 --- a/libstdc++-v3/include/bits/stl_map.h +++ b/libstdc++-v3/include/bits/stl_map.h @@ -94,35 +94,35 @@ namespace __gnu_norm __glibcxx_class_requires(_Tp, _SGIAssignableConcept) __glibcxx_class_requires4(_Compare, bool, _Key, _Key, _BinaryFunctionConcept) - + public: typedef _Key key_type; typedef _Tp mapped_type; typedef pair<const _Key, _Tp> value_type; typedef _Compare key_compare; - + class value_compare : public binary_function<value_type, value_type, bool> { friend class map<_Key,_Tp,_Compare,_Alloc>; protected: _Compare comp; - + value_compare(_Compare __c) : comp(__c) { } - + public: bool operator()(const value_type& __x, const value_type& __y) const { return comp(__x.first, __y.first); } }; - + private: /// @if maint This turns a red-black tree into a [multi]map. @endif typedef _Rb_tree<key_type, value_type, _Select1st<value_type>, key_compare, _Alloc> _Rep_type; /// @if maint The actual tree structure. @endif _Rep_type _M_t; - + public: // many of these are specified differently in ISO, but the following are // "functionally equivalent" @@ -137,7 +137,7 @@ namespace __gnu_norm typedef typename _Rep_type::const_pointer const_pointer; typedef typename _Rep_type::reverse_iterator reverse_iterator; typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator; - + // [23.3.1.1] construct/copy/destroy // (get_allocator() is normally listed in this section, but seems to have // been accidentally omitted in the printed standard) @@ -146,7 +146,7 @@ namespace __gnu_norm */ map() : _M_t(_Compare(), allocator_type()) { } - + // for some reason this was made a separate function /** * @brief Default constructor creates no elements. @@ -154,7 +154,7 @@ namespace __gnu_norm explicit map(const _Compare& __comp, const allocator_type& __a = allocator_type()) : _M_t(__comp, __a) { } - + /** * @brief Map copy constructor. * @param x A %map of identical element and allocator types. @@ -164,7 +164,7 @@ namespace __gnu_norm */ map(const map& __x) : _M_t(__x._M_t) { } - + /** * @brief Builds a %map from a range. * @param first An input iterator. @@ -178,7 +178,7 @@ namespace __gnu_norm map(_InputIterator __first, _InputIterator __last) : _M_t(_Compare(), allocator_type()) { _M_t.insert_unique(__first, __last); } - + /** * @brief Builds a %map from a range. * @param first An input iterator. @@ -195,7 +195,7 @@ namespace __gnu_norm const _Compare& __comp, const allocator_type& __a = allocator_type()) : _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); } - + // FIXME There is no dtor declared, but we should have something generated // by Doxygen. I don't know what tags to add to this paragraph to make // that happen: @@ -204,7 +204,7 @@ namespace __gnu_norm * themselves are pointers, the pointed-to memory is not touched in any * way. Managing the pointer is the user's responsibilty. */ - + /** * @brief Map assignment operator. * @param x A %map of identical element and allocator types. @@ -218,22 +218,22 @@ namespace __gnu_norm _M_t = __x._M_t; return *this; } - + /// Get a copy of the memory allocation object. allocator_type get_allocator() const { return _M_t.get_allocator(); } - + // iterators /** - * Returns a read/write iterator that points to the first pair in the + * Returns a read/write iterator that points to the first pair in the * %map. * Iteration is done in ascending order according to the keys. */ iterator begin() { return _M_t.begin(); } - + /** * Returns a read-only (constant) iterator that points to the first pair * in the %map. Iteration is done in ascending order according to the @@ -242,7 +242,7 @@ namespace __gnu_norm const_iterator begin() const { return _M_t.begin(); } - + /** * Returns a read/write iterator that points one past the last pair in * the %map. Iteration is done in ascending order according to the keys. @@ -250,7 +250,7 @@ namespace __gnu_norm iterator end() { return _M_t.end(); } - + /** * Returns a read-only (constant) iterator that points one past the last * pair in the %map. Iteration is done in ascending order according to @@ -259,7 +259,7 @@ namespace __gnu_norm const_iterator end() const { return _M_t.end(); } - + /** * Returns a read/write reverse iterator that points to the last pair in * the %map. Iteration is done in descending order according to the @@ -268,7 +268,7 @@ namespace __gnu_norm reverse_iterator rbegin() { return _M_t.rbegin(); } - + /** * Returns a read-only (constant) reverse iterator that points to the * last pair in the %map. Iteration is done in descending order @@ -277,7 +277,7 @@ namespace __gnu_norm const_reverse_iterator rbegin() const { return _M_t.rbegin(); } - + /** * Returns a read/write reverse iterator that points to one before the * first pair in the %map. Iteration is done in descending order @@ -286,7 +286,7 @@ namespace __gnu_norm reverse_iterator rend() { return _M_t.rend(); } - + /** * Returns a read-only (constant) reverse iterator that points to one * before the first pair in the %map. Iteration is done in descending @@ -295,7 +295,7 @@ namespace __gnu_norm const_reverse_iterator rend() const { return _M_t.rend(); } - + // capacity /** Returns true if the %map is empty. (Thus begin() would equal * end().) @@ -303,17 +303,17 @@ namespace __gnu_norm bool empty() const { return _M_t.empty(); } - + /** Returns the size of the %map. */ size_type size() const { return _M_t.size(); } - + /** Returns the maximum size of the %map. */ size_type max_size() const { return _M_t.max_size(); } - + // [23.3.1.2] element access /** * @brief Subscript ( @c [] ) access to %map data. @@ -332,14 +332,14 @@ namespace __gnu_norm { // concept requirements __glibcxx_function_requires(_DefaultConstructibleConcept<mapped_type>) - + iterator __i = lower_bound(__k); // __i->first is greater than or equivalent to __k. if (__i == end() || key_comp()(__k, (*__i).first)) __i = insert(__i, value_type(__k, mapped_type())); return (*__i).second; } - + // modifiers /** * @brief Attempts to insert a std::pair into the %map. @@ -358,7 +358,7 @@ namespace __gnu_norm pair<iterator,bool> insert(const value_type& __x) { return _M_t.insert_unique(__x); } - + /** * @brief Attempts to insert a std::pair into the %map. * @param position An iterator that serves as a hint as to where the @@ -382,7 +382,7 @@ namespace __gnu_norm iterator insert(iterator position, const value_type& __x) { return _M_t.insert_unique(position, __x); } - + /** * @brief A template function that attemps to insert a range of elements. * @param first Iterator pointing to the start of the range to be @@ -395,7 +395,7 @@ namespace __gnu_norm void insert(_InputIterator __first, _InputIterator __last) { _M_t.insert_unique(__first, __last); } - + /** * @brief Erases an element from a %map. * @param position An iterator pointing to the element to be erased. @@ -408,7 +408,7 @@ namespace __gnu_norm void erase(iterator __position) { _M_t.erase(__position); } - + /** * @brief Erases elements according to the provided key. * @param x Key of element to be erased. @@ -423,7 +423,7 @@ namespace __gnu_norm size_type erase(const key_type& __x) { return _M_t.erase(__x); } - + /** * @brief Erases a [first,last) range of elements from a %map. * @param first Iterator pointing to the start of the range to be @@ -438,7 +438,7 @@ namespace __gnu_norm void erase(iterator __first, iterator __last) { _M_t.erase(__first, __last); } - + /** * @brief Swaps data with another %map. * @param x A %map of the same element and allocator types. @@ -453,7 +453,7 @@ namespace __gnu_norm void swap(map& __x) { _M_t.swap(__x._M_t); } - + /** * Erases all elements in a %map. Note that this function only erases * the elements, and that if the elements themselves are pointers, the @@ -463,7 +463,7 @@ namespace __gnu_norm void clear() { _M_t.clear(); } - + // observers /** * Returns the key comparison object out of which the %map was @@ -472,7 +472,7 @@ namespace __gnu_norm key_compare key_comp() const { return _M_t.key_comp(); } - + /** * Returns a value comparison object, built from the key comparison * object out of which the %map was constructed. @@ -480,7 +480,7 @@ namespace __gnu_norm value_compare value_comp() const { return value_compare(_M_t.key_comp()); } - + // [23.3.1.3] map operations /** * @brief Tries to locate an element in a %map. @@ -496,7 +496,7 @@ namespace __gnu_norm iterator find(const key_type& __x) { return _M_t.find(__x); } - + /** * @brief Tries to locate an element in a %map. * @param x Key of (key, value) %pair to be located. @@ -511,7 +511,7 @@ namespace __gnu_norm const_iterator find(const key_type& __x) const { return _M_t.find(__x); } - + /** * @brief Finds the number of elements with given key. * @param x Key of (key, value) pairs to be located. @@ -523,7 +523,7 @@ namespace __gnu_norm size_type count(const key_type& __x) const { return _M_t.find(__x) == _M_t.end() ? 0 : 1; } - + /** * @brief Finds the beginning of a subsequence matching given key. * @param x Key of (key, value) pair to be located. @@ -538,7 +538,7 @@ namespace __gnu_norm iterator lower_bound(const key_type& __x) { return _M_t.lower_bound(__x); } - + /** * @brief Finds the beginning of a subsequence matching given key. * @param x Key of (key, value) pair to be located. @@ -553,7 +553,7 @@ namespace __gnu_norm const_iterator lower_bound(const key_type& __x) const { return _M_t.lower_bound(__x); } - + /** * @brief Finds the end of a subsequence matching given key. * @param x Key of (key, value) pair to be located. @@ -563,7 +563,7 @@ namespace __gnu_norm iterator upper_bound(const key_type& __x) { return _M_t.upper_bound(__x); } - + /** * @brief Finds the end of a subsequence matching given key. * @param x Key of (key, value) pair to be located. @@ -573,7 +573,7 @@ namespace __gnu_norm const_iterator upper_bound(const key_type& __x) const { return _M_t.upper_bound(__x); } - + /** * @brief Finds a subsequence matching given key. * @param x Key of (key, value) pairs to be located. @@ -592,7 +592,7 @@ namespace __gnu_norm pair<iterator,iterator> equal_range(const key_type& __x) { return _M_t.equal_range(__x); } - + /** * @brief Finds a subsequence matching given key. * @param x Key of (key, value) pairs to be located. @@ -611,7 +611,7 @@ namespace __gnu_norm pair<const_iterator,const_iterator> equal_range(const key_type& __x) const { return _M_t.equal_range(__x); } - + template <typename _K1, typename _T1, typename _C1, typename _A1> friend bool operator== (const map<_K1,_T1,_C1,_A1>&, @@ -622,7 +622,7 @@ namespace __gnu_norm operator< (const map<_K1,_T1,_C1,_A1>&, const map<_K1,_T1,_C1,_A1>&); }; - + /** * @brief Map equality comparison. * @param x A %map. @@ -638,7 +638,7 @@ namespace __gnu_norm operator==(const map<_Key,_Tp,_Compare,_Alloc>& __x, const map<_Key,_Tp,_Compare,_Alloc>& __y) { return __x._M_t == __y._M_t; } - + /** * @brief Map ordering relation. * @param x A %map. @@ -655,35 +655,35 @@ namespace __gnu_norm operator<(const map<_Key,_Tp,_Compare,_Alloc>& __x, const map<_Key,_Tp,_Compare,_Alloc>& __y) { return __x._M_t < __y._M_t; } - + /// Based on operator== template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> inline bool operator!=(const map<_Key,_Tp,_Compare,_Alloc>& __x, const map<_Key,_Tp,_Compare,_Alloc>& __y) { return !(__x == __y); } - + /// Based on operator< template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> inline bool operator>(const map<_Key,_Tp,_Compare,_Alloc>& __x, const map<_Key,_Tp,_Compare,_Alloc>& __y) { return __y < __x; } - + /// Based on operator< template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> inline bool operator<=(const map<_Key,_Tp,_Compare,_Alloc>& __x, const map<_Key,_Tp,_Compare,_Alloc>& __y) { return !(__y < __x); } - + /// Based on operator< template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> inline bool operator>=(const map<_Key,_Tp,_Compare,_Alloc>& __x, const map<_Key,_Tp,_Compare,_Alloc>& __y) { return !(__x < __y); } - + /// See std::map::swap(). template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> inline void diff --git a/libstdc++-v3/include/bits/stl_multimap.h b/libstdc++-v3/include/bits/stl_multimap.h index 4f442b8c32c..cbc7b07a804 100644 --- a/libstdc++-v3/include/bits/stl_multimap.h +++ b/libstdc++-v3/include/bits/stl_multimap.h @@ -66,22 +66,22 @@ namespace __gnu_norm { // Forward declaration of operators < and ==, needed for friend declaration. - + template <typename _Key, typename _Tp, typename _Compare = less<_Key>, typename _Alloc = allocator<pair<const _Key, _Tp> > > class multimap; - + template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> inline bool operator==(const multimap<_Key,_Tp,_Compare,_Alloc>& __x, const multimap<_Key,_Tp,_Compare,_Alloc>& __y); - + template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> inline bool operator<(const multimap<_Key,_Tp,_Compare,_Alloc>& __x, const multimap<_Key,_Tp,_Compare,_Alloc>& __y); - + /** * @brief A standard container made up of (key,value) pairs, which can be * retrieved based on a key, in logarithmic time. @@ -110,35 +110,35 @@ namespace __gnu_norm __glibcxx_class_requires(_Tp, _SGIAssignableConcept) __glibcxx_class_requires4(_Compare, bool, _Key, _Key, _BinaryFunctionConcept) - + public: typedef _Key key_type; typedef _Tp mapped_type; typedef pair<const _Key, _Tp> value_type; typedef _Compare key_compare; - + class value_compare : public binary_function<value_type, value_type, bool> { friend class multimap<_Key,_Tp,_Compare,_Alloc>; protected: _Compare comp; - + value_compare(_Compare __c) : comp(__c) { } - + public: bool operator()(const value_type& __x, const value_type& __y) const { return comp(__x.first, __y.first); } }; - + private: /// @if maint This turns a red-black tree into a [multi]map. @endif typedef _Rb_tree<key_type, value_type, _Select1st<value_type>, key_compare, _Alloc> _Rep_type; /// @if maint The actual tree structure. @endif _Rep_type _M_t; - + public: // many of these are specified differently in ISO, but the following are // "functionally equivalent" @@ -153,8 +153,8 @@ namespace __gnu_norm typedef typename _Rep_type::const_pointer const_pointer; typedef typename _Rep_type::reverse_iterator reverse_iterator; typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator; - - + + // [23.3.2] construct/copy/destroy // (get_allocator() is also listed in this section) /** @@ -162,7 +162,7 @@ namespace __gnu_norm */ multimap() : _M_t(_Compare(), allocator_type()) { } - + // for some reason this was made a separate function /** * @brief Default constructor creates no elements. @@ -171,7 +171,7 @@ namespace __gnu_norm multimap(const _Compare& __comp, const allocator_type& __a = allocator_type()) : _M_t(__comp, __a) { } - + /** * @brief %Multimap copy constructor. * @param x A %multimap of identical element and allocator types. @@ -181,7 +181,7 @@ namespace __gnu_norm */ multimap(const multimap& __x) : _M_t(__x._M_t) { } - + /** * @brief Builds a %multimap from a range. * @param first An input iterator. @@ -195,7 +195,7 @@ namespace __gnu_norm multimap(_InputIterator __first, _InputIterator __last) : _M_t(_Compare(), allocator_type()) { _M_t.insert_equal(__first, __last); } - + /** * @brief Builds a %multimap from a range. * @param first An input iterator. @@ -213,7 +213,7 @@ namespace __gnu_norm const allocator_type& __a = allocator_type()) : _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); } - + // FIXME There is no dtor declared, but we should have something generated // by Doxygen. I don't know what tags to add to this paragraph to make // that happen: @@ -222,7 +222,7 @@ namespace __gnu_norm * themselves are pointers, the pointed-to memory is not touched in any * way. Managing the pointer is the user's responsibilty. */ - + /** * @brief %Multimap assignment operator. * @param x A %multimap of identical element and allocator types. @@ -236,12 +236,12 @@ namespace __gnu_norm _M_t = __x._M_t; return *this; } - + /// Get a copy of the memory allocation object. allocator_type get_allocator() const { return _M_t.get_allocator(); } - + // iterators /** * Returns a read/write iterator that points to the first pair in the @@ -251,7 +251,7 @@ namespace __gnu_norm iterator begin() { return _M_t.begin(); } - + /** * Returns a read-only (constant) iterator that points to the first pair * in the %multimap. Iteration is done in ascending order according to @@ -260,7 +260,7 @@ namespace __gnu_norm const_iterator begin() const { return _M_t.begin(); } - + /** * Returns a read/write iterator that points one past the last pair in * the %multimap. Iteration is done in ascending order according to the @@ -269,7 +269,7 @@ namespace __gnu_norm iterator end() { return _M_t.end(); } - + /** * Returns a read-only (constant) iterator that points one past the last * pair in the %multimap. Iteration is done in ascending order according @@ -278,7 +278,7 @@ namespace __gnu_norm const_iterator end() const { return _M_t.end(); } - + /** * Returns a read/write reverse iterator that points to the last pair in * the %multimap. Iteration is done in descending order according to the @@ -287,7 +287,7 @@ namespace __gnu_norm reverse_iterator rbegin() { return _M_t.rbegin(); } - + /** * Returns a read-only (constant) reverse iterator that points to the * last pair in the %multimap. Iteration is done in descending order @@ -296,7 +296,7 @@ namespace __gnu_norm const_reverse_iterator rbegin() const { return _M_t.rbegin(); } - + /** * Returns a read/write reverse iterator that points to one before the * first pair in the %multimap. Iteration is done in descending order @@ -305,7 +305,7 @@ namespace __gnu_norm reverse_iterator rend() { return _M_t.rend(); } - + /** * Returns a read-only (constant) reverse iterator that points to one * before the first pair in the %multimap. Iteration is done in @@ -314,23 +314,23 @@ namespace __gnu_norm const_reverse_iterator rend() const { return _M_t.rend(); } - + // capacity /** Returns true if the %multimap is empty. */ bool empty() const { return _M_t.empty(); } - + /** Returns the size of the %multimap. */ size_type size() const { return _M_t.size(); } - + /** Returns the maximum size of the %multimap. */ size_type max_size() const { return _M_t.max_size(); } - + // modifiers /** * @brief Inserts a std::pair into the %multimap. @@ -338,7 +338,7 @@ namespace __gnu_norm * of pairs). * @return An iterator that points to the inserted (key,value) pair. * - * This function inserts a (key, value) pair into the %multimap. + * This function inserts a (key, value) pair into the %multimap. * Contrary to a std::map the %multimap does not rely on unique keys and * thus multiple pairs with the same key can be inserted. * @@ -347,7 +347,7 @@ namespace __gnu_norm iterator insert(const value_type& __x) { return _M_t.insert_equal(__x); } - + /** * @brief Inserts a std::pair into the %multimap. * @param position An iterator that serves as a hint as to where the @@ -356,7 +356,7 @@ namespace __gnu_norm * of pairs). * @return An iterator that points to the inserted (key,value) pair. * - * This function inserts a (key, value) pair into the %multimap. + * This function inserts a (key, value) pair into the %multimap. * Contrary to a std::map the %multimap does not rely on unique keys and * thus multiple pairs with the same key can be inserted. * Note that the first parameter is only a hint and can potentially @@ -371,7 +371,7 @@ namespace __gnu_norm iterator insert(iterator __position, const value_type& __x) { return _M_t.insert_equal(__position, __x); } - + /** * @brief A template function that attemps to insert a range of elements. * @param first Iterator pointing to the start of the range to be @@ -384,7 +384,7 @@ namespace __gnu_norm void insert(_InputIterator __first, _InputIterator __last) { _M_t.insert_equal(__first, __last); } - + /** * @brief Erases an element from a %multimap. * @param position An iterator pointing to the element to be erased. @@ -398,7 +398,7 @@ namespace __gnu_norm void erase(iterator __position) { _M_t.erase(__position); } - + /** * @brief Erases elements according to the provided key. * @param x Key of element to be erased. @@ -413,7 +413,7 @@ namespace __gnu_norm size_type erase(const key_type& __x) { return _M_t.erase(__x); } - + /** * @brief Erases a [first,last) range of elements from a %multimap. * @param first Iterator pointing to the start of the range to be @@ -428,7 +428,7 @@ namespace __gnu_norm void erase(iterator __first, iterator __last) { _M_t.erase(__first, __last); } - + /** * @brief Swaps data with another %multimap. * @param x A %multimap of the same element and allocator types. @@ -443,7 +443,7 @@ namespace __gnu_norm void swap(multimap& __x) { _M_t.swap(__x._M_t); } - + /** * Erases all elements in a %multimap. Note that this function only * erases the elements, and that if the elements themselves are pointers, @@ -453,7 +453,7 @@ namespace __gnu_norm void clear() { _M_t.clear(); } - + // observers /** * Returns the key comparison object out of which the %multimap @@ -462,7 +462,7 @@ namespace __gnu_norm key_compare key_comp() const { return _M_t.key_comp(); } - + /** * Returns a value comparison object, built from the key comparison * object out of which the %multimap was constructed. @@ -470,7 +470,7 @@ namespace __gnu_norm value_compare value_comp() const { return value_compare(_M_t.key_comp()); } - + // multimap operations /** * @brief Tries to locate an element in a %multimap. @@ -486,7 +486,7 @@ namespace __gnu_norm iterator find(const key_type& __x) { return _M_t.find(__x); } - + /** * @brief Tries to locate an element in a %multimap. * @param x Key of (key, value) pair to be located. @@ -501,7 +501,7 @@ namespace __gnu_norm const_iterator find(const key_type& __x) const { return _M_t.find(__x); } - + /** * @brief Finds the number of elements with given key. * @param x Key of (key, value) pairs to be located. @@ -510,7 +510,7 @@ namespace __gnu_norm size_type count(const key_type& __x) const { return _M_t.count(__x); } - + /** * @brief Finds the beginning of a subsequence matching given key. * @param x Key of (key, value) pair to be located. @@ -525,7 +525,7 @@ namespace __gnu_norm iterator lower_bound(const key_type& __x) { return _M_t.lower_bound(__x); } - + /** * @brief Finds the beginning of a subsequence matching given key. * @param x Key of (key, value) pair to be located. @@ -540,7 +540,7 @@ namespace __gnu_norm const_iterator lower_bound(const key_type& __x) const { return _M_t.lower_bound(__x); } - + /** * @brief Finds the end of a subsequence matching given key. * @param x Key of (key, value) pair to be located. @@ -550,7 +550,7 @@ namespace __gnu_norm iterator upper_bound(const key_type& __x) { return _M_t.upper_bound(__x); } - + /** * @brief Finds the end of a subsequence matching given key. * @param x Key of (key, value) pair to be located. @@ -560,7 +560,7 @@ namespace __gnu_norm const_iterator upper_bound(const key_type& __x) const { return _M_t.upper_bound(__x); } - + /** * @brief Finds a subsequence matching given key. * @param x Key of (key, value) pairs to be located. @@ -577,7 +577,7 @@ namespace __gnu_norm pair<iterator,iterator> equal_range(const key_type& __x) { return _M_t.equal_range(__x); } - + /** * @brief Finds a subsequence matching given key. * @param x Key of (key, value) pairs to be located. @@ -594,18 +594,18 @@ namespace __gnu_norm pair<const_iterator,const_iterator> equal_range(const key_type& __x) const { return _M_t.equal_range(__x); } - + template <typename _K1, typename _T1, typename _C1, typename _A1> friend bool operator== (const multimap<_K1,_T1,_C1,_A1>&, const multimap<_K1,_T1,_C1,_A1>&); - + template <typename _K1, typename _T1, typename _C1, typename _A1> friend bool operator< (const multimap<_K1,_T1,_C1,_A1>&, const multimap<_K1,_T1,_C1,_A1>&); }; - + /** * @brief Multimap equality comparison. * @param x A %multimap. @@ -621,7 +621,7 @@ namespace __gnu_norm operator==(const multimap<_Key,_Tp,_Compare,_Alloc>& __x, const multimap<_Key,_Tp,_Compare,_Alloc>& __y) { return __x._M_t == __y._M_t; } - + /** * @brief Multimap ordering relation. * @param x A %multimap. @@ -638,35 +638,35 @@ namespace __gnu_norm operator<(const multimap<_Key,_Tp,_Compare,_Alloc>& __x, const multimap<_Key,_Tp,_Compare,_Alloc>& __y) { return __x._M_t < __y._M_t; } - + /// Based on operator== template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> inline bool operator!=(const multimap<_Key,_Tp,_Compare,_Alloc>& __x, const multimap<_Key,_Tp,_Compare,_Alloc>& __y) { return !(__x == __y); } - + /// Based on operator< template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> inline bool operator>(const multimap<_Key,_Tp,_Compare,_Alloc>& __x, const multimap<_Key,_Tp,_Compare,_Alloc>& __y) { return __y < __x; } - + /// Based on operator< template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> inline bool operator<=(const multimap<_Key,_Tp,_Compare,_Alloc>& __x, const multimap<_Key,_Tp,_Compare,_Alloc>& __y) { return !(__y < __x); } - + /// Based on operator< template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> inline bool operator>=(const multimap<_Key,_Tp,_Compare,_Alloc>& __x, const multimap<_Key,_Tp,_Compare,_Alloc>& __y) { return !(__x < __y); } - + /// See std::multimap::swap(). template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> inline void diff --git a/libstdc++-v3/include/bits/stl_multiset.h b/libstdc++-v3/include/bits/stl_multiset.h index 5a8b29f0b87..c85dbcb754b 100644 --- a/libstdc++-v3/include/bits/stl_multiset.h +++ b/libstdc++-v3/include/bits/stl_multiset.h @@ -73,12 +73,12 @@ namespace __gnu_norm template <class _Key, class _Compare, class _Alloc> inline bool - operator==(const multiset<_Key,_Compare,_Alloc>& __x, + operator==(const multiset<_Key,_Compare,_Alloc>& __x, const multiset<_Key,_Compare,_Alloc>& __y); template <class _Key, class _Compare, class _Alloc> inline bool - operator<(const multiset<_Key,_Compare,_Alloc>& __x, + operator<(const multiset<_Key,_Compare,_Alloc>& __x, const multiset<_Key,_Compare,_Alloc>& __y); /** @@ -108,17 +108,17 @@ namespace __gnu_norm __glibcxx_class_requires(_Key, _SGIAssignableConcept) __glibcxx_class_requires4(_Compare, bool, _Key, _Key, _BinaryFunctionConcept) - + public: // typedefs: typedef _Key key_type; typedef _Key value_type; typedef _Compare key_compare; typedef _Compare value_compare; - + private: /// @if maint This turns a red-black tree into a [multi]set. @endif - typedef _Rb_tree<key_type, value_type, + typedef _Rb_tree<key_type, value_type, _Identity<value_type>, key_compare, _Alloc> _Rep_type; /// @if maint The actual tree structure. @endif _Rep_type _M_t; @@ -137,7 +137,7 @@ namespace __gnu_norm typedef typename _Rep_type::allocator_type allocator_type; // allocation/deallocation - + /** * @brief Default constructor creates no elements. */ @@ -201,12 +201,12 @@ namespace __gnu_norm multiset<_Key,_Compare,_Alloc>& operator=(const multiset<_Key,_Compare,_Alloc>& __x) { - _M_t = __x._M_t; + _M_t = __x._M_t; return *this; } - + // accessors: - + /// Returns the comparison object. key_compare key_comp() const @@ -219,7 +219,7 @@ namespace __gnu_norm allocator_type get_allocator() const { return _M_t.get_allocator(); } - + /** * Returns a read/write iterator that points to the first element in the * %multiset. Iteration is done in ascending order according to the @@ -237,7 +237,7 @@ namespace __gnu_norm iterator end() const { return _M_t.end(); } - + /** * Returns a read/write reverse iterator that points to the last element * in the %multiset. Iteration is done in descending order according to @@ -245,8 +245,8 @@ namespace __gnu_norm */ reverse_iterator rbegin() const - { return _M_t.rbegin(); } - + { return _M_t.rbegin(); } + /** * Returns a read/write reverse iterator that points to the last element * in the %multiset. Iteration is done in descending order according to @@ -255,22 +255,22 @@ namespace __gnu_norm reverse_iterator rend() const { return _M_t.rend(); } - + /// Returns true if the %set is empty. bool empty() const { return _M_t.empty(); } - + /// Returns the size of the %set. size_type size() const { return _M_t.size(); } - + /// Returns the maximum size of the %set. size_type max_size() const { return _M_t.max_size(); } - + /** * @brief Swaps data with another %multiset. * @param x A %multiset of the same element and allocator types. @@ -285,7 +285,7 @@ namespace __gnu_norm void swap(multiset<_Key,_Compare,_Alloc>& __x) { _M_t.swap(__x._M_t); } - + // insert/erase /** * @brief Inserts an element into the %multiset. @@ -301,7 +301,7 @@ namespace __gnu_norm iterator insert(const value_type& __x) { return _M_t.insert_equal(__x); } - + /** * @brief Inserts an element into the %multiset. * @param position An iterator that serves as a hint as to where the @@ -354,11 +354,11 @@ namespace __gnu_norm */ void erase(iterator __position) - { + { typedef typename _Rep_type::iterator _Rep_iterator; - _M_t.erase((_Rep_iterator&)__position); + _M_t.erase((_Rep_iterator&)__position); } - + /** * @brief Erases elements according to the provided key. * @param x Key of element to be erased. @@ -373,7 +373,7 @@ namespace __gnu_norm size_type erase(const key_type& __x) { return _M_t.erase(__x); } - + /** * @brief Erases a [first,last) range of elements from a %multiset. * @param first Iterator pointing to the start of the range to be @@ -387,11 +387,11 @@ namespace __gnu_norm */ void erase(iterator __first, iterator __last) - { + { typedef typename _Rep_type::iterator _Rep_iterator; - _M_t.erase((_Rep_iterator&)__first, (_Rep_iterator&)__last); + _M_t.erase((_Rep_iterator&)__first, (_Rep_iterator&)__last); } - + /** * Erases all elements in a %multiset. Note that this function only * erases the elements, and that if the elements themselves are pointers, @@ -401,9 +401,9 @@ namespace __gnu_norm void clear() { _M_t.clear(); } - + // multiset operations: - + /** * @brief Finds the number of elements with given key. * @param x Key of elements to be located. @@ -412,7 +412,7 @@ namespace __gnu_norm size_type count(const key_type& __x) const { return _M_t.count(__x); } - + // _GLIBCXX_RESOLVE_LIB_DEFECTS // 214. set::find() missing const overload //@{ @@ -430,12 +430,12 @@ namespace __gnu_norm iterator find(const key_type& __x) { return _M_t.find(__x); } - + const_iterator find(const key_type& __x) const { return _M_t.find(__x); } //@} - + //@{ /** * @brief Finds the beginning of a subsequence matching given key. @@ -451,12 +451,12 @@ namespace __gnu_norm iterator lower_bound(const key_type& __x) { return _M_t.lower_bound(__x); } - + const_iterator lower_bound(const key_type& __x) const { return _M_t.lower_bound(__x); } //@} - + //@{ /** * @brief Finds the end of a subsequence matching given key. @@ -467,12 +467,12 @@ namespace __gnu_norm iterator upper_bound(const key_type& __x) { return _M_t.upper_bound(__x); } - + const_iterator upper_bound(const key_type& __x) const { return _M_t.upper_bound(__x); } //@} - + //@{ /** * @brief Finds a subsequence matching given key. @@ -492,11 +492,11 @@ namespace __gnu_norm pair<iterator,iterator> equal_range(const key_type& __x) { return _M_t.equal_range(__x); } - + pair<const_iterator,const_iterator> equal_range(const key_type& __x) const { return _M_t.equal_range(__x); } - + template <class _K1, class _C1, class _A1> friend bool operator== (const multiset<_K1,_C1,_A1>&, @@ -521,10 +521,10 @@ namespace __gnu_norm */ template <class _Key, class _Compare, class _Alloc> inline bool - operator==(const multiset<_Key,_Compare,_Alloc>& __x, + operator==(const multiset<_Key,_Compare,_Alloc>& __x, const multiset<_Key,_Compare,_Alloc>& __y) { return __x._M_t == __y._M_t; } - + /** * @brief Multiset ordering relation. * @param x A %multiset. @@ -538,42 +538,42 @@ namespace __gnu_norm */ template <class _Key, class _Compare, class _Alloc> inline bool - operator<(const multiset<_Key,_Compare,_Alloc>& __x, + operator<(const multiset<_Key,_Compare,_Alloc>& __x, const multiset<_Key,_Compare,_Alloc>& __y) { return __x._M_t < __y._M_t; } /// Returns !(x == y). template <class _Key, class _Compare, class _Alloc> inline bool - operator!=(const multiset<_Key,_Compare,_Alloc>& __x, + operator!=(const multiset<_Key,_Compare,_Alloc>& __x, const multiset<_Key,_Compare,_Alloc>& __y) { return !(__x == __y); } /// Returns y < x. template <class _Key, class _Compare, class _Alloc> inline bool - operator>(const multiset<_Key,_Compare,_Alloc>& __x, + operator>(const multiset<_Key,_Compare,_Alloc>& __x, const multiset<_Key,_Compare,_Alloc>& __y) { return __y < __x; } /// Returns !(y < x) template <class _Key, class _Compare, class _Alloc> inline bool - operator<=(const multiset<_Key,_Compare,_Alloc>& __x, + operator<=(const multiset<_Key,_Compare,_Alloc>& __x, const multiset<_Key,_Compare,_Alloc>& __y) { return !(__y < __x); } /// Returns !(x < y) template <class _Key, class _Compare, class _Alloc> inline bool - operator>=(const multiset<_Key,_Compare,_Alloc>& __x, + operator>=(const multiset<_Key,_Compare,_Alloc>& __x, const multiset<_Key,_Compare,_Alloc>& __y) { return !(__x < __y); } /// See std::multiset::swap(). template <class _Key, class _Compare, class _Alloc> inline void - swap(multiset<_Key,_Compare,_Alloc>& __x, + swap(multiset<_Key,_Compare,_Alloc>& __x, multiset<_Key,_Compare,_Alloc>& __y) { __x.swap(__y); } diff --git a/libstdc++-v3/include/bits/stl_numeric.h b/libstdc++-v3/include/bits/stl_numeric.h index f9ca3b49cf2..58762a40a7d 100644 --- a/libstdc++-v3/include/bits/stl_numeric.h +++ b/libstdc++-v3/include/bits/stl_numeric.h @@ -166,7 +166,7 @@ namespace std typename _BinaryOperation1, typename _BinaryOperation2> _Tp inner_product(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _Tp __init, + _InputIterator2 __first2, _Tp __init, _BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2) { @@ -195,7 +195,7 @@ namespace std * @return Iterator pointing just beyond the values written to result. */ template<typename _InputIterator, typename _OutputIterator> - _OutputIterator + _OutputIterator partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __result) { @@ -231,7 +231,7 @@ namespace std * @return Iterator pointing just beyond the values written to result. */ template<typename _InputIterator, typename _OutputIterator, typename _BinaryOperation> - _OutputIterator + _OutputIterator partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryOperation __binary_op) { @@ -299,7 +299,7 @@ namespace std * @return Iterator pointing just beyond the values written to result. */ template<typename _InputIterator, typename _OutputIterator, typename _BinaryOperation> - _OutputIterator + _OutputIterator adjacent_difference(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryOperation __binary_op) { diff --git a/libstdc++-v3/include/bits/stl_pair.h b/libstdc++-v3/include/bits/stl_pair.h index 46eabb311c9..0bbaa24ad6e 100644 --- a/libstdc++-v3/include/bits/stl_pair.h +++ b/libstdc++-v3/include/bits/stl_pair.h @@ -145,7 +145,7 @@ namespace std inline pair<_T1, _T2> make_pair(_T1 __x, _T2 __y) { return pair<_T1, _T2>(__x, __y); } - + } // namespace std #endif /* _PAIR_H */ diff --git a/libstdc++-v3/include/bits/stl_queue.h b/libstdc++-v3/include/bits/stl_queue.h index 529b87641a6..3583547dbb4 100644 --- a/libstdc++-v3/include/bits/stl_queue.h +++ b/libstdc++-v3/include/bits/stl_queue.h @@ -69,15 +69,15 @@ namespace std // Forward declarations of operators < and ==, needed for friend declaration. template<typename _Tp, typename _Sequence = deque<_Tp> > class queue; - + template<typename _Tp, typename _Seq> - inline bool + inline bool operator==(const queue<_Tp,_Seq>&, const queue<_Tp,_Seq>&); - + template<typename _Tp, typename _Seq> - inline bool + inline bool operator<(const queue<_Tp,_Seq>&, const queue<_Tp,_Seq>&); - + /** * @brief A standard container giving FIFO behavior. * @@ -111,22 +111,22 @@ namespace std __glibcxx_class_requires(_Sequence, _FrontInsertionSequenceConcept) __glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept) __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept) - + template<typename _Tp1, typename _Seq1> - friend bool + friend bool operator==(const queue<_Tp1, _Seq1>&, const queue<_Tp1, _Seq1>&); template<typename _Tp1, typename _Seq1> - friend bool + friend bool operator<(const queue<_Tp1, _Seq1>&, const queue<_Tp1, _Seq1>&); - + public: typedef typename _Sequence::value_type value_type; typedef typename _Sequence::reference reference; typedef typename _Sequence::const_reference const_reference; typedef typename _Sequence::size_type size_type; typedef _Sequence container_type; - + protected: /** * 'c' is the underlying container. Maintainers wondering why @@ -137,70 +137,70 @@ namespace std * containers allow for derivation. Odd.) */ _Sequence c; - + public: /** * @brief Default constructor creates no elements. */ explicit queue(const _Sequence& __c = _Sequence()) : c(__c) {} - + /** * Returns true if the %queue is empty. */ bool empty() const { return c.empty(); } - + /** Returns the number of elements in the %queue. */ size_type size() const { return c.size(); } - + /** * Returns a read/write reference to the data at the first * element of the %queue. */ reference - front() - { + front() + { __glibcxx_requires_nonempty(); - return c.front(); + return c.front(); } - + /** * Returns a read-only (constant) reference to the data at the first * element of the %queue. */ const_reference - front() const - { + front() const + { __glibcxx_requires_nonempty(); - return c.front(); + return c.front(); } - + /** * Returns a read/write reference to the data at the last * element of the %queue. */ reference - back() + back() { __glibcxx_requires_nonempty(); - return c.back(); + return c.back(); } - + /** * Returns a read-only (constant) reference to the data at the last * element of the %queue. */ const_reference - back() const + back() const { __glibcxx_requires_nonempty(); - return c.back(); + return c.back(); } - + /** * @brief Add data to the end of the %queue. * @param x Data to be added. @@ -213,7 +213,7 @@ namespace std void push(const value_type& __x) { c.push_back(__x); } - + /** * @brief Removes first element. * @@ -226,14 +226,14 @@ namespace std * called. */ void - pop() - { + pop() + { __glibcxx_requires_nonempty(); - c.pop_front(); + c.pop_front(); } }; - - + + /** * @brief Queue equality comparison. * @param x A %queue. @@ -246,11 +246,11 @@ namespace std * if their sequences compare equal. */ template<typename _Tp, typename _Sequence> - inline bool - operator==(const queue<_Tp,_Sequence>& __x, + inline bool + operator==(const queue<_Tp,_Sequence>& __x, const queue<_Tp,_Sequence>& __y) { return __x.c == __y.c; } - + /** * @brief Queue ordering relation. * @param x A %queue. @@ -268,34 +268,34 @@ namespace std inline bool operator<(const queue<_Tp,_Sequence>& __x, const queue<_Tp,_Sequence>& __y) { return __x.c < __y.c; } - + /// Based on operator== template<typename _Tp, typename _Sequence> inline bool - operator!=(const queue<_Tp,_Sequence>& __x, + operator!=(const queue<_Tp,_Sequence>& __x, const queue<_Tp,_Sequence>& __y) { return !(__x == __y); } - + /// Based on operator< template<typename _Tp, typename _Sequence> - inline bool + inline bool operator>(const queue<_Tp,_Sequence>& __x, const queue<_Tp,_Sequence>& __y) { return __y < __x; } - + /// Based on operator< template<typename _Tp, typename _Sequence> - inline bool - operator<=(const queue<_Tp,_Sequence>& __x, + inline bool + operator<=(const queue<_Tp,_Sequence>& __x, const queue<_Tp,_Sequence>& __y) { return !(__y < __x); } - + /// Based on operator< template<typename _Tp, typename _Sequence> - inline bool - operator>=(const queue<_Tp,_Sequence>& __x, + inline bool + operator>=(const queue<_Tp,_Sequence>& __x, const queue<_Tp,_Sequence>& __y) { return !(__x < __y); } - + /** * @brief A standard container automatically sorting its contents. * @@ -345,36 +345,36 @@ namespace std __glibcxx_class_requires(_Sequence, _RandomAccessContainerConcept) __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept) __glibcxx_class_requires4(_Compare, bool, _Tp,_Tp,_BinaryFunctionConcept) - + public: typedef typename _Sequence::value_type value_type; typedef typename _Sequence::reference reference; typedef typename _Sequence::const_reference const_reference; typedef typename _Sequence::size_type size_type; typedef _Sequence container_type; - + protected: // See queue::c for notes on these names. _Sequence c; _Compare comp; - + public: /** * @brief Default constructor creates no elements. */ explicit - priority_queue(const _Compare& __x = _Compare(), - const _Sequence& __s = _Sequence()) - : c(__s), comp(__x) + priority_queue(const _Compare& __x = _Compare(), + const _Sequence& __s = _Sequence()) + : c(__s), comp(__x) { std::make_heap(c.begin(), c.end(), comp); } - + /** * @brief Builds a %queue from a range. * @param first An input iterator. * @param last An input iterator. * @param x A comparison functor describing a strict weak ordering. * @param s An initial sequence with which to start. - * + * * Begins by copying @a s, inserting a copy of the elements * from @a [first,last) into the copy of @a s, then ordering * the copy according to @a x. @@ -388,33 +388,33 @@ namespace std const _Compare& __x = _Compare(), const _Sequence& __s = _Sequence()) : c(__s), comp(__x) - { + { __glibcxx_requires_valid_range(__first, __last); c.insert(c.end(), __first, __last); std::make_heap(c.begin(), c.end(), comp); } - + /** * Returns true if the %queue is empty. */ bool empty() const { return c.empty(); } - + /** Returns the number of elements in the %queue. */ size_type size() const { return c.size(); } - + /** * Returns a read-only (constant) reference to the data at the first * element of the %queue. */ const_reference - top() const + top() const { __glibcxx_requires_nonempty(); - return c.front(); + return c.front(); } - + /** * @brief Add data to the %queue. * @param x Data to be added. @@ -423,21 +423,21 @@ namespace std * The time complexity of the operation depends on the underlying * sequence. */ - void - push(const value_type& __x) + void + push(const value_type& __x) { - try + try { - c.push_back(__x); + c.push_back(__x); std::push_heap(c.begin(), c.end(), comp); } catch(...) { c.clear(); - __throw_exception_again; + __throw_exception_again; } } - + /** * @brief Removes first element. * @@ -449,11 +449,11 @@ namespace std * data is needed, it should be retrieved before pop() is * called. */ - void - pop() + void + pop() { __glibcxx_requires_nonempty(); - try + try { std::pop_heap(c.begin(), c.end(), comp); c.pop_back(); @@ -461,11 +461,11 @@ namespace std catch(...) { c.clear(); - __throw_exception_again; + __throw_exception_again; } } }; - + // No equality/comparison operators are provided for priority_queue. } // namespace std diff --git a/libstdc++-v3/include/bits/stl_raw_storage_iter.h b/libstdc++-v3/include/bits/stl_raw_storage_iter.h index 5b40e0a46cb..732142e1e6b 100644 --- a/libstdc++-v3/include/bits/stl_raw_storage_iter.h +++ b/libstdc++-v3/include/bits/stl_raw_storage_iter.h @@ -68,36 +68,36 @@ namespace std * uninitialized memory. */ template <class _ForwardIterator, class _Tp> - class raw_storage_iterator + class raw_storage_iterator : public iterator<output_iterator_tag, void, void, void, void> { protected: _ForwardIterator _M_iter; public: - explicit + explicit raw_storage_iterator(_ForwardIterator __x) : _M_iter(__x) {} - raw_storage_iterator& + raw_storage_iterator& operator*() { return *this; } - raw_storage_iterator& - operator=(const _Tp& __element) + raw_storage_iterator& + operator=(const _Tp& __element) { std::_Construct(&*_M_iter, __element); return *this; - } + } - raw_storage_iterator<_ForwardIterator, _Tp>& - operator++() + raw_storage_iterator<_ForwardIterator, _Tp>& + operator++() { ++_M_iter; return *this; } - raw_storage_iterator<_ForwardIterator, _Tp> - operator++(int) + raw_storage_iterator<_ForwardIterator, _Tp> + operator++(int) { raw_storage_iterator<_ForwardIterator, _Tp> __tmp = *this; ++_M_iter; diff --git a/libstdc++-v3/include/bits/stl_relops.h b/libstdc++-v3/include/bits/stl_relops.h index 812679ccd6e..3e9f060f287 100644 --- a/libstdc++-v3/include/bits/stl_relops.h +++ b/libstdc++-v3/include/bits/stl_relops.h @@ -78,7 +78,7 @@ namespace std /** @namespace std::rel_ops * @brief The generated relational operators are sequestered here. */ - + /** * @brief Defines @c != for arbitrary types, in terms of @c ==. * @param x A thing. diff --git a/libstdc++-v3/include/bits/stl_set.h b/libstdc++-v3/include/bits/stl_set.h index 75fa7f5c3ef..f5619ba8999 100644 --- a/libstdc++-v3/include/bits/stl_set.h +++ b/libstdc++-v3/include/bits/stl_set.h @@ -66,18 +66,18 @@ namespace __gnu_norm { // Forward declarations of operators < and ==, needed for friend declaration. - template<class _Key, class _Compare = less<_Key>, + template<class _Key, class _Compare = less<_Key>, class _Alloc = allocator<_Key> > class set; template<class _Key, class _Compare, class _Alloc> - inline bool - operator==(const set<_Key,_Compare,_Alloc>& __x, + inline bool + operator==(const set<_Key,_Compare,_Alloc>& __x, const set<_Key,_Compare,_Alloc>& __y); template<class _Key, class _Compare, class _Alloc> - inline bool - operator<(const set<_Key,_Compare,_Alloc>& __x, + inline bool + operator<(const set<_Key,_Compare,_Alloc>& __x, const set<_Key,_Compare,_Alloc>& __y); /** @@ -110,7 +110,7 @@ namespace __gnu_norm __glibcxx_class_requires(_Key, _SGIAssignableConcept) __glibcxx_class_requires4(_Compare, bool, _Key, _Key, _BinaryFunctionConcept) - + public: // typedefs: //@{ @@ -122,7 +122,7 @@ namespace __gnu_norm //@} private: - typedef _Rb_tree<key_type, value_type, + typedef _Rb_tree<key_type, value_type, _Identity<value_type>, key_compare, _Alloc> _Rep_type; _Rep_type _M_t; // red-black tree representing set public: @@ -197,7 +197,7 @@ namespace __gnu_norm */ set(const set<_Key,_Compare,_Alloc>& __x) : _M_t(__x._M_t) { } - + /** * @brief Set assignment operator. * @param x A %set of identical element and allocator types. @@ -207,8 +207,8 @@ namespace __gnu_norm */ set<_Key,_Compare,_Alloc>& operator=(const set<_Key, _Compare, _Alloc>& __x) - { - _M_t = __x._M_t; + { + _M_t = __x._M_t; return *this; } @@ -250,7 +250,7 @@ namespace __gnu_norm */ reverse_iterator rbegin() const - { return _M_t.rbegin(); } + { return _M_t.rbegin(); } /** * Returns a read-only (constant) reverse iterator that points to the @@ -307,7 +307,7 @@ namespace __gnu_norm */ pair<iterator,bool> insert(const value_type& __x) - { + { pair<typename _Rep_type::iterator, bool> __p = _M_t.insert_unique(__x); return pair<iterator, bool>(__p.first, __p.second); } @@ -350,7 +350,7 @@ namespace __gnu_norm void insert(_InputIterator __first, _InputIterator __last) { _M_t.insert_unique(__first, __last); } - + /** * @brief Erases an element from a %set. * @param position An iterator pointing to the element to be erased. @@ -362,9 +362,9 @@ namespace __gnu_norm */ void erase(iterator __position) - { + { typedef typename _Rep_type::iterator _Rep_iterator; - _M_t.erase((_Rep_iterator&)__position); + _M_t.erase((_Rep_iterator&)__position); } /** @@ -396,7 +396,7 @@ namespace __gnu_norm erase(iterator __first, iterator __last) { typedef typename _Rep_type::iterator _Rep_iterator; - _M_t.erase((_Rep_iterator&)__first, (_Rep_iterator&)__last); + _M_t.erase((_Rep_iterator&)__first, (_Rep_iterator&)__last); } /** @@ -461,7 +461,7 @@ namespace __gnu_norm iterator lower_bound(const key_type& __x) { return _M_t.lower_bound(__x); } - + const_iterator lower_bound(const key_type& __x) const { return _M_t.lower_bound(__x); } @@ -502,7 +502,7 @@ namespace __gnu_norm pair<iterator,iterator> equal_range(const key_type& __x) { return _M_t.equal_range(__x); } - + pair<const_iterator,const_iterator> equal_range(const key_type& __x) const { return _M_t.equal_range(__x); } @@ -511,7 +511,7 @@ namespace __gnu_norm template<class _K1, class _C1, class _A1> friend bool operator== (const set<_K1,_C1,_A1>&, const set<_K1,_C1,_A1>&); - + template<class _K1, class _C1, class _A1> friend bool operator< (const set<_K1,_C1,_A1>&, const set<_K1,_C1,_A1>&); @@ -530,7 +530,7 @@ namespace __gnu_norm */ template<class _Key, class _Compare, class _Alloc> inline bool - operator==(const set<_Key,_Compare,_Alloc>& __x, + operator==(const set<_Key,_Compare,_Alloc>& __x, const set<_Key,_Compare,_Alloc>& __y) { return __x._M_t == __y._M_t; } @@ -547,35 +547,35 @@ namespace __gnu_norm */ template<class _Key, class _Compare, class _Alloc> inline bool - operator<(const set<_Key,_Compare,_Alloc>& __x, + operator<(const set<_Key,_Compare,_Alloc>& __x, const set<_Key,_Compare,_Alloc>& __y) { return __x._M_t < __y._M_t; } /// Returns !(x == y). template<class _Key, class _Compare, class _Alloc> inline bool - operator!=(const set<_Key,_Compare,_Alloc>& __x, + operator!=(const set<_Key,_Compare,_Alloc>& __x, const set<_Key,_Compare,_Alloc>& __y) { return !(__x == __y); } /// Returns y < x. template<class _Key, class _Compare, class _Alloc> inline bool - operator>(const set<_Key,_Compare,_Alloc>& __x, + operator>(const set<_Key,_Compare,_Alloc>& __x, const set<_Key,_Compare,_Alloc>& __y) { return __y < __x; } /// Returns !(y < x) template<class _Key, class _Compare, class _Alloc> inline bool - operator<=(const set<_Key,_Compare,_Alloc>& __x, + operator<=(const set<_Key,_Compare,_Alloc>& __x, const set<_Key,_Compare,_Alloc>& __y) { return !(__y < __x); } - + /// Returns !(x < y) template<class _Key, class _Compare, class _Alloc> inline bool - operator>=(const set<_Key,_Compare,_Alloc>& __x, + operator>=(const set<_Key,_Compare,_Alloc>& __x, const set<_Key,_Compare,_Alloc>& __y) { return !(__x < __y); } diff --git a/libstdc++-v3/include/bits/stl_stack.h b/libstdc++-v3/include/bits/stl_stack.h index 953b78fee7b..ada50ee350e 100644 --- a/libstdc++-v3/include/bits/stl_stack.h +++ b/libstdc++-v3/include/bits/stl_stack.h @@ -70,15 +70,15 @@ namespace std // declaration. template<typename _Tp, typename _Sequence = deque<_Tp> > class stack; - + template<typename _Tp, typename _Seq> - inline bool + inline bool operator==(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y); - + template<typename _Tp, typename _Seq> - inline bool + inline bool operator<(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y); - + /** * @brief A standard container giving FILO behavior. * @@ -114,26 +114,26 @@ namespace std __glibcxx_class_requires(_Tp, _SGIAssignableConcept) __glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept) __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept) - + template<typename _Tp1, typename _Seq1> - friend bool + friend bool operator==(const stack<_Tp1, _Seq1>&, const stack<_Tp1, _Seq1>&); template<typename _Tp1, typename _Seq1> - friend bool + friend bool operator<(const stack<_Tp1, _Seq1>&, const stack<_Tp1, _Seq1>&); - + public: typedef typename _Sequence::value_type value_type; typedef typename _Sequence::reference reference; typedef typename _Sequence::const_reference const_reference; typedef typename _Sequence::size_type size_type; typedef _Sequence container_type; - + protected: // See queue::c for notes on this name. _Sequence c; - + public: // XXX removed old def ctor, added def arg to this one to match 14882 /** @@ -142,41 +142,41 @@ namespace std explicit stack(const _Sequence& __c = _Sequence()) : c(__c) {} - + /** * Returns true if the %stack is empty. */ bool empty() const { return c.empty(); } - + /** Returns the number of elements in the %stack. */ size_type size() const { return c.size(); } - + /** * Returns a read/write reference to the data at the first * element of the %stack. */ reference - top() - { + top() + { __glibcxx_requires_nonempty(); - return c.back(); + return c.back(); } - + /** * Returns a read-only (constant) reference to the data at the first * element of the %stack. */ const_reference - top() const + top() const { __glibcxx_requires_nonempty(); - return c.back(); + return c.back(); } - + /** * @brief Add data to the top of the %stack. * @param x Data to be added. @@ -189,7 +189,7 @@ namespace std void push(const value_type& __x) { c.push_back(__x); } - + /** * @brief Removes first element. * @@ -202,13 +202,13 @@ namespace std * called. */ void - pop() + pop() { __glibcxx_requires_nonempty(); - c.pop_back(); + c.pop_back(); } }; - + /** * @brief Stack equality comparison. * @param x A %stack. @@ -225,7 +225,7 @@ namespace std inline bool operator==(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y) { return __x.c == __y.c; } - + /** * @brief Stack ordering relation. * @param x A %stack. @@ -243,25 +243,25 @@ namespace std inline bool operator<(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y) { return __x.c < __y.c; } - + /// Based on operator== template<typename _Tp, typename _Seq> inline bool operator!=(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y) { return !(__x == __y); } - + /// Based on operator< template<typename _Tp, typename _Seq> inline bool operator>(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y) { return __y < __x; } - + /// Based on operator< template<typename _Tp, typename _Seq> inline bool operator<=(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y) { return !(__y < __x); } - + /// Based on operator< template<typename _Tp, typename _Seq> inline bool diff --git a/libstdc++-v3/include/bits/stl_tempbuf.h b/libstdc++-v3/include/bits/stl_tempbuf.h index 96f909787bb..399cffb3311 100644 --- a/libstdc++-v3/include/bits/stl_tempbuf.h +++ b/libstdc++-v3/include/bits/stl_tempbuf.h @@ -83,52 +83,52 @@ namespace std typedef value_type* pointer; typedef pointer iterator; typedef ptrdiff_t size_type; - + protected: size_type _M_original_len; size_type _M_len; pointer _M_buffer; - + void _M_initialize_buffer(const _Tp&, __true_type) { } void _M_initialize_buffer(const _Tp& val, __false_type) { std::uninitialized_fill_n(_M_buffer, _M_len, val); } - + public: /// As per Table mumble. size_type size() const { return _M_len; } - + /// Returns the size requested by the constructor; may be >size(). size_type requested_size() const { return _M_original_len; } - + /// As per Table mumble. iterator begin() { return _M_buffer; } - + /// As per Table mumble. iterator end() { return _M_buffer + _M_len; } - + /** * Constructs a temporary buffer of a size somewhere between * zero and the size of the given range. */ _Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last); - + ~_Temporary_buffer() - { + { std::_Destroy(_M_buffer, _M_buffer + _M_len); std::return_temporary_buffer(_M_buffer); } - + private: // Disable copy constructor and assignment operator. _Temporary_buffer(const _Temporary_buffer&); @@ -136,12 +136,12 @@ namespace std void operator=(const _Temporary_buffer&); }; - + template<typename _ForwardIterator, typename _Tp> _Temporary_buffer<_ForwardIterator, _Tp>:: _Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last) - : _M_original_len(std::distance(__first, __last)), + : _M_original_len(std::distance(__first, __last)), _M_len(0), _M_buffer(0) { // Workaround for a __type_traits bug in the pre-7.3 compiler. @@ -158,11 +158,11 @@ namespace std _M_initialize_buffer(*__first, _Trivial()); } catch(...) - { + { std::return_temporary_buffer(_M_buffer); - _M_buffer = 0; + _M_buffer = 0; _M_len = 0; - __throw_exception_again; + __throw_exception_again; } } } // namespace std diff --git a/libstdc++-v3/include/bits/stl_threads.h b/libstdc++-v3/include/bits/stl_threads.h index ffa21a49998..93fb9e99ee6 100644 --- a/libstdc++-v3/include/bits/stl_threads.h +++ b/libstdc++-v3/include/bits/stl_threads.h @@ -85,8 +85,8 @@ namespace __gnu_cxx #endif __gthread_mutex_t _M_lock; - void - _M_initialize() + void + _M_initialize() { #ifdef __GTHREAD_MUTEX_INIT // There should be no code in this path given the usage rules above. @@ -97,7 +97,7 @@ namespace __gnu_cxx && __gthread_active_p()) abort (); __gthread_mutex_lock(&__gnu_cxx::_GLIBCXX_mutex); - if (!_M_init_flag) + if (!_M_init_flag) { // Even though we have a global lock, we use __gthread_once to be // absolutely certain the _M_lock mutex is only initialized once on @@ -113,8 +113,8 @@ namespace __gnu_cxx #endif } - void - _M_acquire_lock() + void + _M_acquire_lock() { #if !defined(__GTHREAD_MUTEX_INIT) && defined(__GTHREAD_MUTEX_INIT_FUNCTION) if (!_M_init_flag) _M_initialize(); @@ -122,8 +122,8 @@ namespace __gnu_cxx __gthread_mutex_lock(&_M_lock); } - void - _M_release_lock() + void + _M_release_lock() { #if !defined(__GTHREAD_MUTEX_INIT) && defined(__GTHREAD_MUTEX_INIT_FUNCTION) if (!_M_init_flag) _M_initialize(); @@ -131,7 +131,7 @@ namespace __gnu_cxx __gthread_mutex_unlock(&_M_lock); } }; - + #ifdef __GTHREAD_MUTEX_INIT #define __STL_MUTEX_INITIALIZER = { __GTHREAD_MUTEX_INIT } #elif defined(__GTHREAD_MUTEX_INIT_FUNCTION) @@ -144,4 +144,4 @@ namespace __gnu_cxx #endif } // namespace __gnu_cxx -#endif +#endif diff --git a/libstdc++-v3/include/bits/stl_tree.h b/libstdc++-v3/include/bits/stl_tree.h index f0d36b72941..35f1c08678c 100644 --- a/libstdc++-v3/include/bits/stl_tree.h +++ b/libstdc++-v3/include/bits/stl_tree.h @@ -89,20 +89,20 @@ iterators invalidated are those referring to the deleted node. #include <bits/stl_function.h> namespace std -{ +{ enum _Rb_tree_color { _S_red = false, _S_black = true }; struct _Rb_tree_node_base { typedef _Rb_tree_node_base* _Base_ptr; typedef const _Rb_tree_node_base* _Const_Base_ptr; - - _Rb_tree_color _M_color; - _Base_ptr _M_parent; - _Base_ptr _M_left; - _Base_ptr _M_right; - - static _Base_ptr + + _Rb_tree_color _M_color; + _Base_ptr _M_parent; + _Base_ptr _M_left; + _Base_ptr _M_right; + + static _Base_ptr _S_minimum(_Base_ptr __x) { while (__x->_M_left != 0) __x = __x->_M_left; @@ -116,7 +116,7 @@ namespace std return __x; } - static _Base_ptr + static _Base_ptr _S_maximum(_Base_ptr __x) { while (__x->_M_right != 0) __x = __x->_M_right; @@ -137,7 +137,7 @@ namespace std typedef _Rb_tree_node<_Val>* _Link_type; _Val _M_value_field; }; - + _Rb_tree_node_base* _Rb_tree_increment(_Rb_tree_node_base* __x); @@ -163,44 +163,44 @@ namespace std typedef _Rb_tree_iterator<_Tp> _Self; typedef _Rb_tree_node_base::_Base_ptr _Base_ptr; typedef _Rb_tree_node<_Tp>* _Link_type; - + _Rb_tree_iterator() {} _Rb_tree_iterator(_Link_type __x) : _M_node(__x) {} - reference + reference operator*() const { return static_cast<_Link_type>(_M_node)->_M_value_field; } - pointer + pointer operator->() const { return &static_cast<_Link_type>(_M_node)->_M_value_field; } - _Self& - operator++() - { + _Self& + operator++() + { _M_node = _Rb_tree_increment(_M_node); - return *this; + return *this; } - _Self - operator++(int) + _Self + operator++(int) { _Self __tmp = *this; _M_node = _Rb_tree_increment(_M_node); return __tmp; } - - _Self& + + _Self& operator--() { _M_node = _Rb_tree_decrement(_M_node); return *this; } - _Self - operator--(int) + _Self + operator--(int) { _Self __tmp = *this; _M_node = _Rb_tree_decrement(_M_node); @@ -233,7 +233,7 @@ namespace std typedef _Rb_tree_const_iterator<_Tp> _Self; typedef _Rb_tree_node_base::_Const_Base_ptr _Base_ptr; typedef const _Rb_tree_node<_Tp>* _Link_type; - + _Rb_tree_const_iterator() {} _Rb_tree_const_iterator(_Link_type __x) @@ -250,30 +250,30 @@ namespace std operator->() const { return &static_cast<_Link_type>(_M_node)->_M_value_field; } - _Self& - operator++() - { + _Self& + operator++() + { _M_node = _Rb_tree_increment(_M_node); - return *this; + return *this; } - _Self - operator++(int) + _Self + operator++(int) { _Self __tmp = *this; _M_node = _Rb_tree_increment(_M_node); return __tmp; } - - _Self& + + _Self& operator--() { _M_node = _Rb_tree_decrement(_M_node); return *this; } - _Self - operator--(int) + _Self + operator--(int) { _Self __tmp = *this; _M_node = _Rb_tree_decrement(_M_node); @@ -292,49 +292,49 @@ namespace std }; template<typename _Val> - inline bool + inline bool operator==(const _Rb_tree_iterator<_Val>& __x, - const _Rb_tree_const_iterator<_Val>& __y) + const _Rb_tree_const_iterator<_Val>& __y) { return __x._M_node == __y._M_node; } template<typename _Val> - inline bool + inline bool operator!=(const _Rb_tree_iterator<_Val>& __x, - const _Rb_tree_const_iterator<_Val>& __y) + const _Rb_tree_const_iterator<_Val>& __y) { return __x._M_node != __y._M_node; } - void + void _Rb_tree_rotate_left(_Rb_tree_node_base* const __x, _Rb_tree_node_base*& __root); - void + void _Rb_tree_rotate_right(_Rb_tree_node_base* const __x, _Rb_tree_node_base*& __root); - void + void _Rb_tree_insert_and_rebalance(const bool __insert_left, _Rb_tree_node_base* __x, _Rb_tree_node_base* __p, _Rb_tree_node_base& __header); _Rb_tree_node_base* - _Rb_tree_rebalance_for_erase(_Rb_tree_node_base* const __z, - _Rb_tree_node_base& __header); + _Rb_tree_rebalance_for_erase(_Rb_tree_node_base* const __z, + _Rb_tree_node_base& __header); - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc = allocator<_Val> > class _Rb_tree : protected _Alloc::template rebind<_Rb_tree_node<_Val> >::other { typedef typename _Alloc::template rebind<_Rb_tree_node<_Val> >::other _Node_allocator; - + protected: typedef _Rb_tree_node_base* _Base_ptr; typedef const _Rb_tree_node_base* _Const_Base_ptr; typedef _Rb_tree_node<_Val> _Rb_tree_node; - + public: typedef _Key key_type; typedef _Val value_type; @@ -346,35 +346,35 @@ namespace std typedef const _Rb_tree_node* _Const_Link_type; typedef size_t size_type; typedef ptrdiff_t difference_type; - + typedef _Alloc allocator_type; allocator_type get_allocator() const { return *static_cast<const _Node_allocator*>(this); } - + protected: _Rb_tree_node* _M_get_node() { return _Node_allocator::allocate(1); } - void + void _M_put_node(_Rb_tree_node* __p) { _Node_allocator::deallocate(__p, 1); } - + _Link_type _M_create_node(const value_type& __x) { _Link_type __tmp = _M_get_node(); - try + try { std::_Construct(&__tmp->_M_value_field, __x); } catch(...) { _M_put_node(__tmp); - __throw_exception_again; + __throw_exception_again; } return __tmp; } - - _Link_type + + _Link_type _M_clone_node(_Const_Link_type __x) { _Link_type __tmp = _M_create_node(__x->_M_value_field); @@ -395,7 +395,7 @@ namespace std _Rb_tree_node_base _M_header; size_type _M_node_count; // keeps track of size of tree _Compare _M_key_compare; - + protected: _Base_ptr& _M_root() @@ -437,11 +437,11 @@ namespace std _M_end() const { return static_cast<_Const_Link_type>(&this->_M_header); } - static const_reference + static const_reference _S_value(_Const_Link_type __x) { return __x->_M_value_field; } - static const _Key& + static const _Key& _S_key(_Const_Link_type __x) { return _KeyOfValue()(_S_value(__x)); } @@ -465,12 +465,12 @@ namespace std _S_value(_Const_Base_ptr __x) { return static_cast<_Const_Link_type>(__x)->_M_value_field; } - static const _Key& + static const _Key& _S_key(_Const_Base_ptr __x) { return _KeyOfValue()(_S_value(__x)); } - static _Base_ptr - _S_minimum(_Base_ptr __x) + static _Base_ptr + _S_minimum(_Base_ptr __x) { return _Rb_tree_node_base::_S_minimum(__x); } static _Const_Base_ptr @@ -493,13 +493,13 @@ namespace std typedef std::reverse_iterator<const_iterator> const_reverse_iterator; private: - iterator + iterator _M_insert(_Base_ptr __x, _Base_ptr __y, const value_type& __v); - _Link_type + _Link_type _M_copy(_Const_Link_type __x, _Link_type __p); - void + void _M_erase(_Link_type __x); public: @@ -513,23 +513,23 @@ namespace std _Rb_tree(const _Compare& __comp) : _Node_allocator(allocator_type()), _M_node_count(0), - _M_key_compare(__comp) + _M_key_compare(__comp) { _M_empty_initialize(); } _Rb_tree(const _Compare& __comp, const allocator_type& __a) : _Node_allocator(__a), _M_node_count(0), - _M_key_compare(__comp) + _M_key_compare(__comp) { _M_empty_initialize(); } - _Rb_tree(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x) + _Rb_tree(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x) : _Node_allocator(__x.get_allocator()), - _M_node_count(0), + _M_node_count(0), _M_key_compare(__x._M_key_compare) - { + { if (__x._M_root() == 0) _M_empty_initialize(); - else + else { this->_M_header._M_color = _S_red; _M_root() = _M_copy(__x._M_begin(), _M_end()); @@ -542,34 +542,34 @@ namespace std ~_Rb_tree() { _M_erase(_M_begin()); } - _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& + _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& operator=(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x); private: - void _M_empty_initialize() + void _M_empty_initialize() { // Used to distinguish header from __root, in iterator.operator++. - this->_M_header._M_color = _S_red; + this->_M_header._M_color = _S_red; _M_root() = 0; _M_leftmost() = _M_end(); _M_rightmost() = _M_end(); } - public: + public: // Accessors. - _Compare + _Compare key_comp() const { return _M_key_compare; } - iterator + iterator begin() { return static_cast<_Link_type>(this->_M_header._M_left); } - const_iterator + const_iterator begin() const { return static_cast<_Const_Link_type>(this->_M_header._M_left); } - iterator + iterator end() { return static_cast<_Link_type>(&this->_M_header); } @@ -577,68 +577,68 @@ namespace std end() const { return static_cast<_Const_Link_type>(&this->_M_header); } - reverse_iterator + reverse_iterator rbegin() { return reverse_iterator(end()); } - const_reverse_iterator + const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); } - reverse_iterator + reverse_iterator rend() { return reverse_iterator(begin()); } - const_reverse_iterator + const_reverse_iterator rend() const { return const_reverse_iterator(begin()); } - - bool + + bool empty() const { return _M_node_count == 0; } - size_type + size_type size() const { return _M_node_count; } - size_type + size_type max_size() const { return size_type(-1); } - void + void swap(_Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __t); - + // Insert/erase. - pair<iterator,bool> + pair<iterator,bool> insert_unique(const value_type& __x); - iterator + iterator insert_equal(const value_type& __x); - iterator + iterator insert_unique(iterator __position, const value_type& __x); - iterator + iterator insert_equal(iterator __position, const value_type& __x); template<typename _InputIterator> - void + void insert_unique(_InputIterator __first, _InputIterator __last); template<typename _InputIterator> - void + void insert_equal(_InputIterator __first, _InputIterator __last); - void + void erase(iterator __position); - size_type + size_type erase(const key_type& __x); - void + void erase(iterator __first, iterator __last); - void + void erase(const key_type* __first, const key_type* __last); void @@ -652,105 +652,105 @@ namespace std } // Set operations. - iterator + iterator find(const key_type& __x); - const_iterator + const_iterator find(const key_type& __x) const; - size_type + size_type count(const key_type& __x) const; - iterator + iterator lower_bound(const key_type& __x); - const_iterator + const_iterator lower_bound(const key_type& __x) const; - iterator + iterator upper_bound(const key_type& __x); - const_iterator + const_iterator upper_bound(const key_type& __x) const; - pair<iterator,iterator> + pair<iterator,iterator> equal_range(const key_type& __x); - pair<const_iterator, const_iterator> + pair<const_iterator, const_iterator> equal_range(const key_type& __x) const; // Debugging. - bool + bool __rb_verify() const; }; - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> - inline bool - operator==(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x, + inline bool + operator==(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x, const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __y) { return __x.size() == __y.size() && equal(__x.begin(), __x.end(), __y.begin()); } - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> - inline bool - operator<(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x, + inline bool + operator<(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x, const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __y) { return lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end()); } - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> - inline bool - operator!=(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x, - const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __y) + inline bool + operator!=(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x, + const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __y) { return !(__x == __y); } - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> - inline bool - operator>(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x, - const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __y) + inline bool + operator>(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x, + const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __y) { return __y < __x; } - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> - inline bool - operator<=(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x, - const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __y) + inline bool + operator<=(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x, + const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __y) { return !(__y < __x); } - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> - inline bool - operator>=(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x, - const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __y) + inline bool + operator>=(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x, + const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __y) { return !(__x < __y); } - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> - inline void - swap(_Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x, + inline void + swap(_Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x, _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __y) { __x.swap(__y); } - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> - _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& + _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: operator=(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x) { - if (this != &__x) + if (this != &__x) { // Note that _Key may be a constant type. clear(); - _M_key_compare = __x._M_key_compare; - if (__x._M_root() != 0) + _M_key_compare = __x._M_key_compare; + if (__x._M_root() != 0) { _M_root() = _M_copy(__x._M_begin(), _M_end()); _M_leftmost() = _S_minimum(_M_root()); @@ -761,7 +761,7 @@ namespace std return *this; } - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: @@ -778,7 +778,7 @@ namespace std return iterator(__z); } - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: @@ -786,7 +786,7 @@ namespace std { _Link_type __x = _M_begin(); _Link_type __y = _M_end(); - while (__x != 0) + while (__x != 0) { __y = __x; __x = _M_key_compare(_KeyOfValue()(__v), _S_key(__x)) ? @@ -795,7 +795,7 @@ namespace std return _M_insert(__x, __y, __v); } - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> void _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: @@ -840,9 +840,9 @@ namespace std std::swap(this->_M_key_compare, __t._M_key_compare); } - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> - pair<typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator, + pair<typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator, bool> _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: insert_unique(const _Val& __v) @@ -866,97 +866,97 @@ namespace std return pair<iterator,bool>(_M_insert(__x, __y, __v), true); return pair<iterator,bool>(__j, false); } - - template<typename _Key, typename _Val, typename _KeyOfValue, + + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> - typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator + typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: insert_unique(iterator __position, const _Val& __v) { if (__position._M_node == _M_leftmost()) - { + { // begin() if (size() > 0 && _M_key_compare(_KeyOfValue()(__v), _S_key(__position._M_node))) return _M_insert(__position._M_node, __position._M_node, __v); - // first argument just needs to be non-null + // first argument just needs to be non-null else return insert_unique(__v).first; - } - else if (__position._M_node == _M_end()) - { + } + else if (__position._M_node == _M_end()) + { // end() if (_M_key_compare(_S_key(_M_rightmost()), _KeyOfValue()(__v))) return _M_insert(0, _M_rightmost(), __v); else return insert_unique(__v).first; - } - else + } + else { iterator __before = __position; --__before; - if (_M_key_compare(_S_key(__before._M_node), _KeyOfValue()(__v)) + if (_M_key_compare(_S_key(__before._M_node), _KeyOfValue()(__v)) && _M_key_compare(_KeyOfValue()(__v),_S_key(__position._M_node))) { if (_S_right(__before._M_node) == 0) - return _M_insert(0, __before._M_node, __v); + return _M_insert(0, __before._M_node, __v); else return _M_insert(__position._M_node, __position._M_node, __v); - // first argument just needs to be non-null - } + // first argument just needs to be non-null + } else return insert_unique(__v).first; } } - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> - typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator + typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: insert_equal(iterator __position, const _Val& __v) { if (__position._M_node == _M_leftmost()) - { + { // begin() if (size() > 0 && !_M_key_compare(_S_key(__position._M_node), _KeyOfValue()(__v))) return _M_insert(__position._M_node, __position._M_node, __v); - // first argument just needs to be non-null + // first argument just needs to be non-null else return insert_equal(__v); - } - else if (__position._M_node == _M_end()) + } + else if (__position._M_node == _M_end()) { // end() if (!_M_key_compare(_KeyOfValue()(__v), _S_key(_M_rightmost()))) return _M_insert(0, _M_rightmost(), __v); else return insert_equal(__v); - } - else + } + else { iterator __before = __position; --__before; if (!_M_key_compare(_KeyOfValue()(__v), _S_key(__before._M_node)) && !_M_key_compare(_S_key(__position._M_node), - _KeyOfValue()(__v))) + _KeyOfValue()(__v))) { if (_S_right(__before._M_node) == 0) - return _M_insert(0, __before._M_node, __v); + return _M_insert(0, __before._M_node, __v); else return _M_insert(__position._M_node, __position._M_node, __v); - // first argument just needs to be non-null - } + // first argument just needs to be non-null + } else return insert_equal(__v); } } - template<typename _Key, typename _Val, typename _KoV, + template<typename _Key, typename _Val, typename _KoV, typename _Cmp, typename _Alloc> template<class _II> - void + void _Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>:: insert_equal(_II __first, _II __last) { @@ -964,32 +964,32 @@ namespace std insert_equal(*__first); } - template<typename _Key, typename _Val, typename _KoV, - typename _Cmp, typename _Alloc> + template<typename _Key, typename _Val, typename _KoV, + typename _Cmp, typename _Alloc> template<class _II> - void + void _Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>:: - insert_unique(_II __first, _II __last) + insert_unique(_II __first, _II __last) { for ( ; __first != __last; ++__first) insert_unique(*__first); } - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> - inline void + inline void _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::erase(iterator __position) { - _Link_type __y = + _Link_type __y = static_cast<_Link_type>(_Rb_tree_rebalance_for_erase(__position._M_node, this->_M_header)); destroy_node(__y); --_M_node_count; } - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> - typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::size_type + typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::size_type _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::erase(const _Key& __x) { pair<iterator,iterator> __p = equal_range(__x); @@ -998,24 +998,24 @@ namespace std return __n; } - template<typename _Key, typename _Val, typename _KoV, + template<typename _Key, typename _Val, typename _KoV, typename _Compare, typename _Alloc> - typename _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::_Link_type + typename _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::_Link_type _Rb_tree<_Key,_Val,_KoV,_Compare,_Alloc>:: _M_copy(_Const_Link_type __x, _Link_type __p) { // Structural copy. __x and __p must be non-null. _Link_type __top = _M_clone_node(__x); __top->_M_parent = __p; - - try + + try { if (__x->_M_right) __top->_M_right = _M_copy(_S_right(__x), __top); __p = __top; __x = _S_left(__x); - - while (__x != 0) + + while (__x != 0) { _Link_type __y = _M_clone_node(__x); __p->_M_left = __y; @@ -1029,18 +1029,18 @@ namespace std catch(...) { _M_erase(__top); - __throw_exception_again; + __throw_exception_again; } return __top; } - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> - void + void _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::_M_erase(_Link_type __x) { // Erase without rebalancing. - while (__x != 0) + while (__x != 0) { _M_erase(_S_right(__x)); _Link_type __y = _S_left(__x); @@ -1049,9 +1049,9 @@ namespace std } } - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> - void + void _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: erase(iterator __first, iterator __last) { @@ -1061,36 +1061,36 @@ namespace std while (__first != __last) erase(__first++); } - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> - void + void _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: - erase(const _Key* __first, const _Key* __last) - { - while (__first != __last) - erase(*__first++); + erase(const _Key* __first, const _Key* __last) + { + while (__first != __last) + erase(*__first++); } - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> - typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator + typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::find(const _Key& __k) { _Link_type __x = _M_begin(); // Current node. _Link_type __y = _M_end(); // Last node which is not less than __k. - - while (__x != 0) + + while (__x != 0) if (!_M_key_compare(_S_key(__x), __k)) __y = __x, __x = _S_left(__x); else __x = _S_right(__x); - - iterator __j = iterator(__y); - return (__j == end() || _M_key_compare(__k, _S_key(__j._M_node))) ? + + iterator __j = iterator(__y); + return (__j == end() || _M_key_compare(__k, _S_key(__j._M_node))) ? end() : __j; } - - template<typename _Key, typename _Val, typename _KeyOfValue, + + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::const_iterator _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: @@ -1098,22 +1098,22 @@ namespace std { _Const_Link_type __x = _M_begin(); // Current node. _Const_Link_type __y = _M_end(); // Last node which is not less than __k. - - while (__x != 0) + + while (__x != 0) { if (!_M_key_compare(_S_key(__x), __k)) __y = __x, __x = _S_left(__x); else __x = _S_right(__x); - } - const_iterator __j = const_iterator(__y); + } + const_iterator __j = const_iterator(__y); return (__j == end() || _M_key_compare(__k, _S_key(__j._M_node))) ? end() : __j; } - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> - typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::size_type + typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::size_type _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: count(const _Key& __k) const { @@ -1122,81 +1122,81 @@ namespace std return __n; } - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> - typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator + typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: lower_bound(const _Key& __k) { _Link_type __x = _M_begin(); // Current node. _Link_type __y = _M_end(); // Last node which is not less than __k. - - while (__x != 0) + + while (__x != 0) if (!_M_key_compare(_S_key(__x), __k)) __y = __x, __x = _S_left(__x); else __x = _S_right(__x); - + return iterator(__y); } - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> - typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::const_iterator + typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::const_iterator _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: lower_bound(const _Key& __k) const { _Const_Link_type __x = _M_begin(); // Current node. _Const_Link_type __y = _M_end(); // Last node which is not less than __k. - - while (__x != 0) + + while (__x != 0) if (!_M_key_compare(_S_key(__x), __k)) __y = __x, __x = _S_left(__x); else __x = _S_right(__x); - + return const_iterator(__y); } - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> - typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator + typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: upper_bound(const _Key& __k) { _Link_type __x = _M_begin(); // Current node. _Link_type __y = _M_end(); // Last node which is greater than __k. - - while (__x != 0) + + while (__x != 0) if (_M_key_compare(__k, _S_key(__x))) __y = __x, __x = _S_left(__x); else __x = _S_right(__x); - + return iterator(__y); } - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> - typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::const_iterator + typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::const_iterator _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>:: upper_bound(const _Key& __k) const { _Const_Link_type __x = _M_begin(); // Current node. _Const_Link_type __y = _M_end(); // Last node which is greater than __k. - - while (__x != 0) + + while (__x != 0) if (_M_key_compare(__k, _S_key(__x))) __y = __x, __x = _S_left(__x); else __x = _S_right(__x); - + return const_iterator(__y); } - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> - inline + inline pair<typename _Rb_tree<_Key,_Val,_KeyOfValue, _Compare,_Alloc>::iterator, typename _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::iterator> @@ -1204,9 +1204,9 @@ namespace std equal_range(const _Key& __k) { return pair<iterator, iterator>(lower_bound(__k), upper_bound(__k)); } - template<typename _Key, typename _Val, typename _KoV, + template<typename _Key, typename _Val, typename _KoV, typename _Compare, typename _Alloc> - inline + inline pair<typename _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::const_iterator, typename _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::const_iterator> @@ -1219,43 +1219,43 @@ namespace std _Rb_tree_black_count(const _Rb_tree_node_base* __node, const _Rb_tree_node_base* __root); - template<typename _Key, typename _Val, typename _KeyOfValue, + template<typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> - bool + bool _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::__rb_verify() const { if (_M_node_count == 0 || begin() == end()) return _M_node_count == 0 && begin() == end() && this->_M_header._M_left == _M_end() && this->_M_header._M_right == _M_end(); - + unsigned int __len = _Rb_tree_black_count(_M_leftmost(), _M_root()); - for (const_iterator __it = begin(); __it != end(); ++__it) + for (const_iterator __it = begin(); __it != end(); ++__it) { _Const_Link_type __x = static_cast<_Const_Link_type>(__it._M_node); _Const_Link_type __L = _S_left(__x); _Const_Link_type __R = _S_right(__x); - + if (__x->_M_color == _S_red) - if ((__L && __L->_M_color == _S_red) + if ((__L && __L->_M_color == _S_red) || (__R && __R->_M_color == _S_red)) return false; - + if (__L && _M_key_compare(_S_key(__x), _S_key(__L))) return false; if (__R && _M_key_compare(_S_key(__R), _S_key(__x))) return false; - + if (!__L && !__R && _Rb_tree_black_count(__x, _M_root()) != __len) return false; } - + if (_M_leftmost() != _Rb_tree_node_base::_S_minimum(_M_root())) return false; if (_M_rightmost() != _Rb_tree_node_base::_S_maximum(_M_root())) return false; return true; } -} // namespace std +} // namespace std -#endif +#endif diff --git a/libstdc++-v3/include/bits/stl_uninitialized.h b/libstdc++-v3/include/bits/stl_uninitialized.h index ecf6981232b..f4f8d187f64 100644 --- a/libstdc++-v3/include/bits/stl_uninitialized.h +++ b/libstdc++-v3/include/bits/stl_uninitialized.h @@ -67,20 +67,20 @@ namespace std { // uninitialized_copy template<typename _InputIterator, typename _ForwardIterator> - inline _ForwardIterator + inline _ForwardIterator __uninitialized_copy_aux(_InputIterator __first, _InputIterator __last, _ForwardIterator __result, __true_type) { return std::copy(__first, __last, __result); } template<typename _InputIterator, typename _ForwardIterator> - inline _ForwardIterator + inline _ForwardIterator __uninitialized_copy_aux(_InputIterator __first, _InputIterator __last, _ForwardIterator __result, __false_type) { _ForwardIterator __cur = __result; - try + try { for ( ; __first != __last; ++__first, ++__cur) std::_Construct(&*__cur, *__first); @@ -89,7 +89,7 @@ namespace std catch(...) { std::_Destroy(__result, __cur); - __throw_exception_again; + __throw_exception_again; } } @@ -104,7 +104,7 @@ namespace std */ template<typename _InputIterator, typename _ForwardIterator> inline _ForwardIterator - uninitialized_copy(_InputIterator __first, _InputIterator __last, + uninitialized_copy(_InputIterator __first, _InputIterator __last, _ForwardIterator __result) { typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; @@ -120,7 +120,7 @@ namespace std return __result + (__last - __first); } - inline wchar_t* + inline wchar_t* uninitialized_copy(const wchar_t* __first, const wchar_t* __last, wchar_t* __result) { @@ -132,14 +132,14 @@ namespace std // destructor is trivial. template<typename _ForwardIterator, typename _Tp> inline void - __uninitialized_fill_aux(_ForwardIterator __first, - _ForwardIterator __last, + __uninitialized_fill_aux(_ForwardIterator __first, + _ForwardIterator __last, const _Tp& __x, __true_type) { std::fill(__first, __last, __x); } template<typename _ForwardIterator, typename _Tp> void - __uninitialized_fill_aux(_ForwardIterator __first, _ForwardIterator __last, + __uninitialized_fill_aux(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __x, __false_type) { _ForwardIterator __cur = __first; @@ -151,7 +151,7 @@ namespace std catch(...) { std::_Destroy(__first, __cur); - __throw_exception_again; + __throw_exception_again; } } @@ -166,7 +166,7 @@ namespace std */ template<typename _ForwardIterator, typename _Tp> inline void - uninitialized_fill(_ForwardIterator __first, _ForwardIterator __last, + uninitialized_fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __x) { typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; @@ -188,16 +188,16 @@ namespace std const _Tp& __x, __false_type) { _ForwardIterator __cur = __first; - try + try { for ( ; __n > 0; --__n, ++__cur) std::_Construct(&*__cur, __x); return __cur; } catch(...) - { + { std::_Destroy(__first, __cur); - __throw_exception_again; + __throw_exception_again; } } @@ -211,7 +211,7 @@ namespace std * Like fill_n(), but does not require an initialized output range. */ template<typename _ForwardIterator, typename _Size, typename _Tp> - inline _ForwardIterator + inline _ForwardIterator uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x) { typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; @@ -219,7 +219,7 @@ namespace std return std::__uninitialized_fill_n_aux(__first, __n, __x, _Is_POD()); } - // Extensions: __uninitialized_copy_copy, __uninitialized_copy_fill, + // Extensions: __uninitialized_copy_copy, __uninitialized_copy_fill, // __uninitialized_fill_copy. // __uninitialized_copy_copy @@ -227,12 +227,12 @@ namespace std // copies [first2, last2) into // [result, result + (last1 - first1) + (last2 - first2)). - template<typename _InputIterator1, typename _InputIterator2, + template<typename _InputIterator1, typename _InputIterator2, typename _ForwardIterator> inline _ForwardIterator - __uninitialized_copy_copy(_InputIterator1 __first1, + __uninitialized_copy_copy(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, + _InputIterator2 __first2, _InputIterator2 __last2, _ForwardIterator __result) { @@ -243,9 +243,9 @@ namespace std return std::uninitialized_copy(__first2, __last2, __mid); } catch(...) - { + { std::_Destroy(__result, __mid); - __throw_exception_again; + __throw_exception_again; } } @@ -253,7 +253,7 @@ namespace std // Fills [result, mid) with x, and copies [first, last) into // [mid, mid + (last - first)). template<typename _ForwardIterator, typename _Tp, typename _InputIterator> - inline _ForwardIterator + inline _ForwardIterator __uninitialized_fill_copy(_ForwardIterator __result, _ForwardIterator __mid, const _Tp& __x, _InputIterator __first, _InputIterator __last) @@ -266,7 +266,7 @@ namespace std catch(...) { std::_Destroy(__result, __mid); - __throw_exception_again; + __throw_exception_again; } } @@ -279,16 +279,16 @@ namespace std _ForwardIterator __first2, _ForwardIterator __last2, const _Tp& __x) { - _ForwardIterator __mid2 = std::uninitialized_copy(__first1, __last1, + _ForwardIterator __mid2 = std::uninitialized_copy(__first1, __last1, __first2); - try + try { std::uninitialized_fill(__mid2, __last2, __x); } catch(...) { std::_Destroy(__first2, __mid2); - __throw_exception_again; + __throw_exception_again; } } diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h index fd9f6a9f092..06048015b87 100644 --- a/libstdc++-v3/include/bits/stl_vector.h +++ b/libstdc++-v3/include/bits/stl_vector.h @@ -84,7 +84,7 @@ namespace __gnu_norm _Vector_base(const allocator_type& __a) : _Alloc(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0) { } - + _Vector_base(size_t __n, const allocator_type& __a) : _Alloc(__a) { @@ -92,25 +92,25 @@ namespace __gnu_norm this->_M_finish = this->_M_start; this->_M_end_of_storage = this->_M_start + __n; } - - ~_Vector_base() - { _M_deallocate(this->_M_start, + + ~_Vector_base() + { _M_deallocate(this->_M_start, this->_M_end_of_storage - this->_M_start); } public: _Tp* _M_start; _Tp* _M_finish; _Tp* _M_end_of_storage; - + _Tp* _M_allocate(size_t __n) { return _Alloc::allocate(__n); } - + void _M_deallocate(_Tp* __p, size_t __n) { if (__p) _Alloc::deallocate(__p, __n); } }; - - + + /** * @brief A standard container which offers fixed time access to * individual elements in any order. @@ -135,25 +135,25 @@ namespace __gnu_norm { // Concept requirements. __glibcxx_class_requires(_Tp, _SGIAssignableConcept) - - typedef _Vector_base<_Tp, _Alloc> _Base; - typedef vector<_Tp, _Alloc> vector_type; - + + typedef _Vector_base<_Tp, _Alloc> _Base; + typedef vector<_Tp, _Alloc> vector_type; + public: - typedef _Tp value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; + typedef _Tp value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; typedef __gnu_cxx::__normal_iterator<pointer, vector_type> iterator; typedef __gnu_cxx::__normal_iterator<const_pointer, vector_type> const_iterator; - typedef std::reverse_iterator<const_iterator> const_reverse_iterator; - typedef std::reverse_iterator<iterator> reverse_iterator; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef typename _Base::allocator_type allocator_type; - + typedef std::reverse_iterator<const_iterator> const_reverse_iterator; + typedef std::reverse_iterator<iterator> reverse_iterator; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef typename _Base::allocator_type allocator_type; + protected: /** @if maint * These two functions and three data members are all from the @@ -165,7 +165,7 @@ namespace __gnu_norm using _Base::_M_start; using _Base::_M_finish; using _Base::_M_end_of_storage; - + public: // [23.2.4.1] construct/copy/destroy // (assign() and get_allocator() are also listed in this section) @@ -175,24 +175,24 @@ namespace __gnu_norm explicit vector(const allocator_type& __a = allocator_type()) : _Base(__a) { } - + /** * @brief Create a %vector with copies of an exemplar element. * @param n The number of elements to initially create. * @param value An element to copy. - * + * * This constructor fills the %vector with @a n copies of @a value. */ vector(size_type __n, const value_type& __value, const allocator_type& __a = allocator_type()) : _Base(__n, __a) - { this->_M_finish = std::uninitialized_fill_n(this->_M_start, + { this->_M_finish = std::uninitialized_fill_n(this->_M_start, __n, __value); } - + /** * @brief Create a %vector with default elements. * @param n The number of elements to initially create. - * + * * This constructor fills the %vector with @a n copies of a * default-constructed element. */ @@ -201,11 +201,11 @@ namespace __gnu_norm : _Base(__n, allocator_type()) { this->_M_finish = std::uninitialized_fill_n(this->_M_start, __n, value_type()); } - + /** * @brief %Vector copy constructor. * @param x A %vector of identical element and allocator types. - * + * * The newly-created %vector uses a copy of the allocation * object used by @a x. All the elements of @a x are copied, * but any extra memory in @@ -216,12 +216,12 @@ namespace __gnu_norm { this->_M_finish = std::uninitialized_copy(__x.begin(), __x.end(), this->_M_start); } - + /** * @brief Builds a %vector from a range. * @param first An input iterator. * @param last An input iterator. - * + * * Create a %vector consisting of copies of the elements from * [first,last). * @@ -241,7 +241,7 @@ namespace __gnu_norm typedef typename _Is_integer<_InputIterator>::_Integral _Integral; _M_initialize_dispatch(__first, __last, _Integral()); } - + /** * The dtor only erases the elements, and note that if the * elements themselves are pointers, the pointed-to memory is @@ -249,18 +249,18 @@ namespace __gnu_norm * responsibilty. */ ~vector() { std::_Destroy(this->_M_start, this->_M_finish); } - + /** * @brief %Vector assignment operator. * @param x A %vector of identical element and allocator types. - * + * * All the elements of @a x are copied, but any extra memory in * @a x (for fast expansion) will not be copied. Unlike the * copy constructor, the allocator object is not copied. */ vector& operator=(const vector& __x); - + /** * @brief Assigns a given value to a %vector. * @param n Number of elements to be assigned. @@ -272,9 +272,9 @@ namespace __gnu_norm * the number of elements assigned. Old data may be lost. */ void - assign(size_type __n, const value_type& __val) + assign(size_type __n, const value_type& __val) { _M_fill_assign(__n, __val); } - + /** * @brief Assigns a range to a %vector. * @param first An input iterator. @@ -295,10 +295,10 @@ namespace __gnu_norm typedef typename _Is_integer<_InputIterator>::_Integral _Integral; _M_assign_dispatch(__first, __last, _Integral()); } - + /// Get a copy of the memory allocation object. using _Base::get_allocator; - + // iterators /** * Returns a read/write iterator that points to the first @@ -307,7 +307,7 @@ namespace __gnu_norm */ iterator begin() { return iterator (this->_M_start); } - + /** * Returns a read-only (constant) iterator that points to the * first element in the %vector. Iteration is done in ordinary @@ -315,7 +315,7 @@ namespace __gnu_norm */ const_iterator begin() const { return const_iterator (this->_M_start); } - + /** * Returns a read/write iterator that points one past the last * element in the %vector. Iteration is done in ordinary @@ -323,7 +323,7 @@ namespace __gnu_norm */ iterator end() { return iterator (this->_M_finish); } - + /** * Returns a read-only (constant) iterator that points one past * the last element in the %vector. Iteration is done in @@ -331,7 +331,7 @@ namespace __gnu_norm */ const_iterator end() const { return const_iterator (this->_M_finish); } - + /** * Returns a read/write reverse iterator that points to the * last element in the %vector. Iteration is done in reverse @@ -339,7 +339,7 @@ namespace __gnu_norm */ reverse_iterator rbegin() { return reverse_iterator(end()); } - + /** * Returns a read-only (constant) reverse iterator that points * to the last element in the %vector. Iteration is done in @@ -347,7 +347,7 @@ namespace __gnu_norm */ const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); } - + /** * Returns a read/write reverse iterator that points to one * before the first element in the %vector. Iteration is done @@ -355,7 +355,7 @@ namespace __gnu_norm */ reverse_iterator rend() { return reverse_iterator(begin()); } - + /** * Returns a read-only (constant) reverse iterator that points * to one before the first element in the %vector. Iteration @@ -363,16 +363,16 @@ namespace __gnu_norm */ const_reverse_iterator rend() const { return const_reverse_iterator(begin()); } - + // [23.2.4.2] capacity /** Returns the number of elements in the %vector. */ size_type size() const { return size_type(end() - begin()); } - + /** Returns the size() of the largest possible %vector. */ size_type max_size() const { return size_type(-1) / sizeof(value_type); } - + /** * @brief Resizes the %vector to the specified number of elements. * @param new_size Number of elements the %vector should contain. @@ -392,7 +392,7 @@ namespace __gnu_norm else insert(end(), __new_size - size(), __x); } - + /** * @brief Resizes the %vector to the specified number of elements. * @param new_size Number of elements the %vector should contain. @@ -405,7 +405,7 @@ namespace __gnu_norm */ void resize(size_type __new_size) { resize(__new_size, value_type()); } - + /** * Returns the total number of elements that the %vector can * hold before needing to allocate more memory. @@ -413,14 +413,14 @@ namespace __gnu_norm size_type capacity() const { return size_type(const_iterator(this->_M_end_of_storage) - begin()); } - + /** * Returns true if the %vector is empty. (Thus begin() would * equal end().) */ bool empty() const { return begin() == end(); } - + /** * @brief Attempt to preallocate enough memory for specified number of * elements. @@ -440,7 +440,7 @@ namespace __gnu_norm */ void reserve(size_type __n); - + // element access /** * @brief Subscript access to the data contained in the %vector. @@ -455,7 +455,7 @@ namespace __gnu_norm */ reference operator[](size_type __n) { return *(begin() + __n); } - + /** * @brief Subscript access to the data contained in the %vector. * @param n The index of the element for which data should be @@ -469,7 +469,7 @@ namespace __gnu_norm */ const_reference operator[](size_type __n) const { return *(begin() + __n); } - + protected: /// @if maint Safety check used only from at(). @endif void @@ -478,7 +478,7 @@ namespace __gnu_norm if (__n >= this->size()) __throw_out_of_range(__N("vector::_M_range_check")); } - + public: /** * @brief Provides access to the data contained in the %vector. @@ -493,7 +493,7 @@ namespace __gnu_norm */ reference at(size_type __n) { _M_range_check(__n); return (*this)[__n]; } - + /** * @brief Provides access to the data contained in the %vector. * @param n The index of the element for which data should be @@ -507,35 +507,35 @@ namespace __gnu_norm */ const_reference at(size_type __n) const { _M_range_check(__n); return (*this)[__n]; } - + /** * Returns a read/write reference to the data at the first * element of the %vector. */ reference front() { return *begin(); } - + /** * Returns a read-only (constant) reference to the data at the first * element of the %vector. */ const_reference front() const { return *begin(); } - + /** * Returns a read/write reference to the data at the last * element of the %vector. */ reference back() { return *(end() - 1); } - + /** * Returns a read-only (constant) reference to the data at the * last element of the %vector. */ const_reference back() const { return *(end() - 1); } - + // [23.2.4.3] modifiers /** * @brief Add data to the end of the %vector. @@ -558,7 +558,7 @@ namespace __gnu_norm else _M_insert_aux(end(), __x); } - + /** * @brief Removes last element. * @@ -574,7 +574,7 @@ namespace __gnu_norm --this->_M_finish; std::_Destroy(this->_M_finish); } - + /** * @brief Inserts given value into %vector before specified iterator. * @param position An iterator into the %vector. @@ -605,7 +605,7 @@ namespace __gnu_norm void insert(iterator __position, size_type __n, const value_type& __x) { _M_fill_insert(__position, __n, __x); } - + /** * @brief Inserts a range into the %vector. * @param position An iterator into the %vector. @@ -622,14 +622,14 @@ namespace __gnu_norm */ template<typename _InputIterator> void - insert(iterator __position, _InputIterator __first, + insert(iterator __position, _InputIterator __first, _InputIterator __last) { // Check whether it's an integral type. If so, it's not an iterator. typedef typename _Is_integer<_InputIterator>::_Integral _Integral; _M_insert_dispatch(__position, __first, __last, _Integral()); } - + /** * @brief Remove element at given position. * @param position Iterator pointing to element to be erased. @@ -647,7 +647,7 @@ namespace __gnu_norm */ iterator erase(iterator __position); - + /** * @brief Remove a range of elements. * @param first Iterator pointing to the first element to be erased. @@ -668,7 +668,7 @@ namespace __gnu_norm */ iterator erase(iterator __first, iterator __last); - + /** * @brief Swaps data with another %vector. * @param x A %vector of the same element and allocator types. @@ -685,7 +685,7 @@ namespace __gnu_norm std::swap(this->_M_finish, __x._M_finish); std::swap(this->_M_end_of_storage, __x._M_end_of_storage); } - + /** * Erases all the elements. Note that this function only erases the * elements, and that if the elements themselves are pointers, the @@ -694,7 +694,7 @@ namespace __gnu_norm */ void clear() { erase(begin(), end()); } - + protected: /** * @if maint @@ -719,10 +719,10 @@ namespace __gnu_norm __throw_exception_again; } } - - + + // Internal constructor functions follow. - + // Called by the range constructor to implement [23.1.1]/9 template<typename _Integer> void @@ -730,10 +730,10 @@ namespace __gnu_norm { this->_M_start = _M_allocate(__n); this->_M_end_of_storage = this->_M_start + __n; - this->_M_finish = std::uninitialized_fill_n(this->_M_start, + this->_M_finish = std::uninitialized_fill_n(this->_M_start, __n, __value); } - + // Called by the range constructor to implement [23.1.1]/9 template<typename _InputIterator> void @@ -744,7 +744,7 @@ namespace __gnu_norm _IterCategory; _M_range_initialize(__first, __last, _IterCategory()); } - + // Called by the second initialize_dispatch above template<typename _InputIterator> void @@ -754,10 +754,10 @@ namespace __gnu_norm for ( ; __first != __last; ++__first) push_back(*__first); } - + // Called by the second initialize_dispatch above template<typename _ForwardIterator> - void + void _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last, forward_iterator_tag) { @@ -767,11 +767,11 @@ namespace __gnu_norm this->_M_finish = std::uninitialized_copy(__first, __last, this->_M_start); } - - + + // Internal assign functions follow. The *_aux functions do the actual // assignment work for the range versions. - + // Called by the range assign to implement [23.1.1]/9 template<typename _Integer> void @@ -780,38 +780,38 @@ namespace __gnu_norm _M_fill_assign(static_cast<size_type>(__n), static_cast<value_type>(__val)); } - + // Called by the range assign to implement [23.1.1]/9 template<typename _InputIterator> void - _M_assign_dispatch(_InputIterator __first, _InputIterator __last, + _M_assign_dispatch(_InputIterator __first, _InputIterator __last, __false_type) { typedef typename iterator_traits<_InputIterator>::iterator_category _IterCategory; _M_assign_aux(__first, __last, _IterCategory()); } - + // Called by the second assign_dispatch above template<typename _InputIterator> - void + void _M_assign_aux(_InputIterator __first, _InputIterator __last, input_iterator_tag); - + // Called by the second assign_dispatch above template<typename _ForwardIterator> - void + void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last, forward_iterator_tag); - + // Called by assign(n,t), and the range assign when it turns out // to be the same thing. void _M_fill_assign(size_type __n, const value_type& __val); - - + + // Internal insert functions follow. - + // Called by the range insert to implement [23.1.1]/9 template<typename _Integer> void @@ -821,7 +821,7 @@ namespace __gnu_norm _M_fill_insert(__pos, static_cast<size_type>(__n), static_cast<value_type>(__val)); } - + // Called by the range insert to implement [23.1.1]/9 template<typename _InputIterator> void @@ -832,30 +832,30 @@ namespace __gnu_norm _IterCategory; _M_range_insert(__pos, __first, __last, _IterCategory()); } - + // Called by the second insert_dispatch above template<typename _InputIterator> void - _M_range_insert(iterator __pos, _InputIterator __first, + _M_range_insert(iterator __pos, _InputIterator __first, _InputIterator __last, input_iterator_tag); - + // Called by the second insert_dispatch above template<typename _ForwardIterator> void - _M_range_insert(iterator __pos, _ForwardIterator __first, + _M_range_insert(iterator __pos, _ForwardIterator __first, _ForwardIterator __last, forward_iterator_tag); - + // Called by insert(p,n,x), and the range insert when it turns out to be // the same thing. void _M_fill_insert(iterator __pos, size_type __n, const value_type& __x); - + // Called by insert(p,x) void _M_insert_aux(iterator __position, const value_type& __x); }; - - + + /** * @brief Vector equality comparison. * @param x A %vector. @@ -873,7 +873,7 @@ namespace __gnu_norm return __x.size() == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin()); } - + /** * @brief Vector ordering relation. * @param x A %vector. @@ -892,31 +892,31 @@ namespace __gnu_norm return std::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end()); } - + /// Based on operator== template<typename _Tp, typename _Alloc> inline bool operator!=(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y) { return !(__x == __y); } - + /// Based on operator< template<typename _Tp, typename _Alloc> inline bool operator>(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y) { return __y < __x; } - + /// Based on operator< template<typename _Tp, typename _Alloc> inline bool operator<=(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y) { return !(__y < __x); } - + /// Based on operator< template<typename _Tp, typename _Alloc> inline bool operator>=(const vector<_Tp,_Alloc>& __x, const vector<_Tp,_Alloc>& __y) { return !(__x < __y); } - + /// See std::vector::swap(). template<typename _Tp, typename _Alloc> inline void diff --git a/libstdc++-v3/include/bits/stream_iterator.h b/libstdc++-v3/include/bits/stream_iterator.h index 0433fe0de3a..fa11bd6b28f 100644 --- a/libstdc++-v3/include/bits/stream_iterator.h +++ b/libstdc++-v3/include/bits/stream_iterator.h @@ -42,9 +42,9 @@ namespace std { /// Provides input iterator semantics for streams. - template<typename _Tp, typename _CharT = char, - typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t> - class istream_iterator + template<typename _Tp, typename _CharT = char, + typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t> + class istream_iterator : public iterator<input_iterator_tag, _Tp, _Dist, const _Tp*, const _Tp&> { public: @@ -53,9 +53,9 @@ namespace std typedef basic_istream<_CharT, _Traits> istream_type; private: - istream_type* _M_stream; - _Tp _M_value; - bool _M_ok; + istream_type* _M_stream; + _Tp _M_value; + bool _M_ok; public: /// Construct end of input stream iterator. @@ -67,14 +67,14 @@ namespace std : _M_stream(&__s) { _M_read(); } - istream_iterator(const istream_iterator& __obj) - : _M_stream(__obj._M_stream), _M_value(__obj._M_value), - _M_ok(__obj._M_ok) + istream_iterator(const istream_iterator& __obj) + : _M_stream(__obj._M_stream), _M_value(__obj._M_value), + _M_ok(__obj._M_ok) { } const _Tp& - operator*() const - { + operator*() const + { __glibcxx_requires_cond(_M_ok, _M_message(__gnu_debug::__msg_deref_istream) ._M_iterator(*this)); @@ -84,34 +84,34 @@ namespace std const _Tp* operator->() const { return &(operator*()); } - istream_iterator& - operator++() - { + istream_iterator& + operator++() + { __glibcxx_requires_cond(_M_ok, _M_message(__gnu_debug::__msg_inc_istream) ._M_iterator(*this)); - _M_read(); - return *this; + _M_read(); + return *this; } - istream_iterator - operator++(int) + istream_iterator + operator++(int) { __glibcxx_requires_cond(_M_ok, _M_message(__gnu_debug::__msg_inc_istream) - ._M_iterator(*this)); + ._M_iterator(*this)); istream_iterator __tmp = *this; _M_read(); return __tmp; } - bool + bool _M_equal(const istream_iterator& __x) const { return (_M_ok == __x._M_ok) && (!_M_ok || _M_stream == __x._M_stream); } - private: - void - _M_read() + private: + void + _M_read() { _M_ok = (_M_stream && *_M_stream) ? true : false; if (_M_ok) @@ -121,19 +121,19 @@ namespace std } } }; - + /// Return true if x and y are both end or not end, or x and y are the same. template<typename _Tp, typename _CharT, typename _Traits, typename _Dist> - inline bool + inline bool operator==(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x, - const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y) + const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y) { return __x._M_equal(__y); } /// Return false if x and y are both end or not end, or x and y are the same. template <class _Tp, class _CharT, class _Traits, class _Dist> - inline bool + inline bool operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x, - const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y) + const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y) { return !__x._M_equal(__y); } /** @@ -147,9 +147,9 @@ namespace std * @param CharT The ostream char_type. * @param Traits The ostream char_traits. */ - template<typename _Tp, typename _CharT = char, + template<typename _Tp, typename _CharT = char, typename _Traits = char_traits<_CharT> > - class ostream_iterator + class ostream_iterator : public iterator<output_iterator_tag, void, void, void, void> { public: @@ -161,8 +161,8 @@ namespace std //@} private: - ostream_type* _M_stream; - const _CharT* _M_string; + ostream_type* _M_stream; + const _CharT* _M_string; public: /// Construct from an ostream. @@ -178,7 +178,7 @@ namespace std * @param s Underlying ostream to write to. * @param c CharT delimiter string to insert. */ - ostream_iterator(ostream_type& __s, const _CharT* __c) + ostream_iterator(ostream_type& __s, const _CharT* __c) : _M_stream(&__s), _M_string(__c) { } /// Copy constructor. @@ -187,9 +187,9 @@ namespace std /// Writes @a value to underlying ostream using operator<<. If /// constructed with delimiter string, writes delimiter to ostream. - ostream_iterator& - operator=(const _Tp& __value) - { + ostream_iterator& + operator=(const _Tp& __value) + { __glibcxx_requires_cond(_M_stream != 0, _M_message(__gnu_debug::__msg_output_ostream) ._M_iterator(*this)); @@ -197,18 +197,18 @@ namespace std if (_M_string) *_M_stream << _M_string; return *this; } - - ostream_iterator& + + ostream_iterator& operator*() { return *this; } - - ostream_iterator& + + ostream_iterator& operator++() - { return *this; } - - ostream_iterator& + { return *this; } + + ostream_iterator& operator++(int) - { return *this; } + { return *this; } }; } // namespace std #endif diff --git a/libstdc++-v3/include/bits/streambuf.tcc b/libstdc++-v3/include/bits/streambuf.tcc index 4cc9bf1590a..554d0617899 100644 --- a/libstdc++-v3/include/bits/streambuf.tcc +++ b/libstdc++-v3/include/bits/streambuf.tcc @@ -37,7 +37,7 @@ #pragma GCC system_header -namespace std +namespace std { template<typename _CharT, typename _Traits> streamsize @@ -57,10 +57,10 @@ namespace std __s += __len; this->gbump(__len); } - + if (__ret < __n) { - const int_type __c = this->uflow(); + const int_type __c = this->uflow(); if (!traits_type::eq_int_type(__c, traits_type::eof())) { traits_type::assign(*__s++, traits_type::to_char_type(__c)); @@ -114,7 +114,7 @@ namespace std template<typename _CharT, typename _Traits> streamsize __copy_streambufs(basic_streambuf<_CharT, _Traits>* __sbin, - basic_streambuf<_CharT, _Traits>* __sbout) + basic_streambuf<_CharT, _Traits>* __sbout) { streamsize __ret = 0; typename _Traits::int_type __c = __sbin->sgetc(); @@ -130,7 +130,7 @@ namespace std break; __c = __sbin->underflow(); } - else + else { __c = __sbout->sputc(_Traits::to_char_type(__c)); if (_Traits::eq_int_type(__c, _Traits::eof())) @@ -143,21 +143,21 @@ namespace std } // Inhibit implicit instantiations for required instantiations, - // which are defined via explicit instantiations elsewhere. + // which are defined via explicit instantiations elsewhere. // NB: This syntax is a GNU extension. #if _GLIBCXX_EXTERN_TEMPLATE extern template class basic_streambuf<char>; extern template streamsize - __copy_streambufs(basic_streambuf<char>*, basic_streambuf<char>*); + __copy_streambufs(basic_streambuf<char>*, basic_streambuf<char>*); #ifdef _GLIBCXX_USE_WCHAR_T extern template class basic_streambuf<wchar_t>; extern template streamsize - __copy_streambufs(basic_streambuf<wchar_t>*, basic_streambuf<wchar_t>*); + __copy_streambufs(basic_streambuf<wchar_t>*, basic_streambuf<wchar_t>*); #endif #endif } // namespace std -#endif +#endif diff --git a/libstdc++-v3/include/bits/streambuf_iterator.h b/libstdc++-v3/include/bits/streambuf_iterator.h index b11d24c6a2c..970933578c7 100644 --- a/libstdc++-v3/include/bits/streambuf_iterator.h +++ b/libstdc++-v3/include/bits/streambuf_iterator.h @@ -50,35 +50,35 @@ namespace std template<typename _CharT, typename _Traits> class istreambuf_iterator : public iterator<input_iterator_tag, _CharT, typename _Traits::off_type, - _CharT*, _CharT&> + _CharT*, _CharT&> { public: // Types: //@{ /// Public typedefs - typedef _CharT char_type; - typedef _Traits traits_type; - typedef typename _Traits::int_type int_type; - typedef basic_streambuf<_CharT, _Traits> streambuf_type; - typedef basic_istream<_CharT, _Traits> istream_type; + typedef _CharT char_type; + typedef _Traits traits_type; + typedef typename _Traits::int_type int_type; + typedef basic_streambuf<_CharT, _Traits> streambuf_type; + typedef basic_istream<_CharT, _Traits> istream_type; //@} private: - // 24.5.3 istreambuf_iterator - // p 1 + // 24.5.3 istreambuf_iterator + // p 1 // If the end of stream is reached (streambuf_type::sgetc() // returns traits_type::eof()), the iterator becomes equal to // the "end of stream" iterator value. // NB: This implementation assumes the "end of stream" value // is EOF, or -1. - mutable streambuf_type* _M_sbuf; - int_type _M_c; + mutable streambuf_type* _M_sbuf; + int_type _M_c; public: /// Construct end of input stream iterator. - istreambuf_iterator() throw() + istreambuf_iterator() throw() : _M_sbuf(0), _M_c(traits_type::eof()) { } - + /// Construct start of input stream iterator. istreambuf_iterator(istream_type& __s) throw() : _M_sbuf(__s.rdbuf()), _M_c(traits_type::eof()) { } @@ -86,36 +86,36 @@ namespace std /// Construct start of streambuf iterator. istreambuf_iterator(streambuf_type* __s) throw() : _M_sbuf(__s), _M_c(traits_type::eof()) { } - + /// Return the current character pointed to by iterator. This returns /// streambuf.sgetc(). It cannot be assigned. NB: The result of /// operator*() on an end of stream is undefined. - char_type + char_type operator*() const - { + { #ifdef _GLIBCXX_DEBUG_PEDANTIC // Dereferencing a past-the-end istreambuf_iterator is a // libstdc++ extension __glibcxx_requires_cond(!_M_at_eof(), _M_message(__gnu_debug::__msg_deref_istreambuf) - ._M_iterator(*this)); + ._M_iterator(*this)); #endif - return traits_type::to_char_type(_M_get()); + return traits_type::to_char_type(_M_get()); } /// Advance the iterator. Calls streambuf.sbumpc(). - istreambuf_iterator& + istreambuf_iterator& operator++() - { + { __glibcxx_requires_cond(!_M_at_eof(), _M_message(__gnu_debug::__msg_inc_istreambuf) - ._M_iterator(*this)); + ._M_iterator(*this)); const int_type __eof = traits_type::eof(); if (_M_sbuf && traits_type::eq_int_type(_M_sbuf->sbumpc(), __eof)) _M_sbuf = 0; else _M_c = __eof; - return *this; + return *this; } /// Advance the iterator. Calls streambuf.sbumpc(). @@ -124,24 +124,24 @@ namespace std { __glibcxx_requires_cond(!_M_at_eof(), _M_message(__gnu_debug::__msg_inc_istreambuf) - ._M_iterator(*this)); + ._M_iterator(*this)); const int_type __eof = traits_type::eof(); istreambuf_iterator __old = *this; if (_M_sbuf - && traits_type::eq_int_type((__old._M_c = _M_sbuf->sbumpc()), + && traits_type::eq_int_type((__old._M_c = _M_sbuf->sbumpc()), __eof)) _M_sbuf = 0; else _M_c = __eof; - return __old; + return __old; } // _GLIBCXX_RESOLVE_LIB_DEFECTS // 110 istreambuf_iterator::equal not const // NB: there is also number 111 (NAD, Future) pending on this function. /// Return true both iterators are end or both are not end. - bool + bool equal(const istreambuf_iterator& __b) const { const bool __thiseof = _M_at_eof(); @@ -150,13 +150,13 @@ namespace std } private: - int_type + int_type _M_get() const - { + { const int_type __eof = traits_type::eof(); int_type __ret = __eof; if (_M_sbuf) - { + { if (!traits_type::eq_int_type(_M_c, __eof)) __ret = _M_c; else if (traits_type::eq_int_type((__ret = _M_sbuf->sgetc()), @@ -166,7 +166,7 @@ namespace std return __ret; } - bool + bool _M_at_eof() const { const int_type __eof = traits_type::eof(); @@ -175,13 +175,13 @@ namespace std }; template<typename _CharT, typename _Traits> - inline bool + inline bool operator==(const istreambuf_iterator<_CharT, _Traits>& __a, const istreambuf_iterator<_CharT, _Traits>& __b) { return __a.equal(__b); } template<typename _CharT, typename _Traits> - inline bool + inline bool operator!=(const istreambuf_iterator<_CharT, _Traits>& __a, const istreambuf_iterator<_CharT, _Traits>& __b) { return !__a.equal(__b); } @@ -202,49 +202,49 @@ namespace std //@} private: - streambuf_type* _M_sbuf; - bool _M_failed; + streambuf_type* _M_sbuf; + bool _M_failed; public: /// Construct output iterator from ostream. ostreambuf_iterator(ostream_type& __s) throw () : _M_sbuf(__s.rdbuf()), _M_failed(!_M_sbuf) { } - + /// Construct output iterator from streambuf. ostreambuf_iterator(streambuf_type* __s) throw () : _M_sbuf(__s), _M_failed(!_M_sbuf) { } /// Write character to streambuf. Calls streambuf.sputc(). - ostreambuf_iterator& + ostreambuf_iterator& operator=(_CharT __c) { - if (!_M_failed && + if (!_M_failed && _Traits::eq_int_type(_M_sbuf->sputc(__c), _Traits::eof())) _M_failed = true; return *this; } /// Return *this. - ostreambuf_iterator& + ostreambuf_iterator& operator*() { return *this; } /// Return *this. - ostreambuf_iterator& + ostreambuf_iterator& operator++(int) { return *this; } /// Return *this. - ostreambuf_iterator& + ostreambuf_iterator& operator++() { return *this; } /// Return true if previous operator=() failed. - bool + bool failed() const throw() { return _M_failed; } - ostreambuf_iterator& + ostreambuf_iterator& _M_put(const _CharT* __ws, streamsize __len) { if (__builtin_expect(!_M_failed, true) diff --git a/libstdc++-v3/include/bits/stringfwd.h b/libstdc++-v3/include/bits/stringfwd.h index 75775804a1b..99d3ce3a534 100644 --- a/libstdc++-v3/include/bits/stringfwd.h +++ b/libstdc++-v3/include/bits/stringfwd.h @@ -45,16 +45,16 @@ namespace std { - template<typename _Alloc> + template<typename _Alloc> class allocator; template<class _CharT> struct char_traits; - template<typename _CharT, typename _Traits = char_traits<_CharT>, + template<typename _CharT, typename _Traits = char_traits<_CharT>, typename _Alloc = allocator<_CharT> > class basic_string; - + template<> struct char_traits<char>; typedef basic_string<char> string; diff --git a/libstdc++-v3/include/bits/type_traits.h b/libstdc++-v3/include/bits/type_traits.h index be82c4bf2d2..9b91e5c5cdf 100644 --- a/libstdc++-v3/include/bits/type_traits.h +++ b/libstdc++-v3/include/bits/type_traits.h @@ -74,10 +74,10 @@ attain their correct values by one of these means: EXAMPLE: //Copy an array of elements which have non-trivial copy constructors -template <class _Tp> void +template <class _Tp> void copy(_Tp* __source,_Tp* __destination,int __n,__false_type); //Copy an array of elements which have trivial copy constructors. Use memcpy. -template <class _Tp> void +template <class _Tp> void copy(_Tp* __source,_Tp* __destination,int __n,__true_type); //Copy an array of any type by using the most efficient copy mechanism @@ -92,7 +92,7 @@ struct __false_type {}; template <class _Tp> struct __type_traits - { + { typedef __true_type this_dummy_member_must_be_first; /* Do not remove this member. It informs a compiler which automatically specializes __type_traits that this @@ -101,7 +101,7 @@ template <class _Tp> called __type_traits for something unrelated. */ /* The following restrictions should be observed for the sake of - compilers which automatically produce type specific specializations + compilers which automatically produce type specific specializations of this class: - You may reorder the members below if you wish - You may remove any of the members below if you wish @@ -109,7 +109,7 @@ template <class _Tp> name change in the compiler - Members you add will be treated like regular members unless you add the appropriate support in the compiler. */ - + typedef __false_type has_trivial_default_constructor; typedef __false_type has_trivial_copy_constructor; @@ -291,7 +291,7 @@ template <class _Tp> typedef __true_type is_POD_type; }; -// The following could be written in terms of numeric_limits. +// The following could be written in terms of numeric_limits. // We're doing it separately to reduce the number of dependencies. template <class _Tp> diff --git a/libstdc++-v3/include/bits/valarray_after.h b/libstdc++-v3/include/bits/valarray_after.h index 2506a4bdde4..b74cab5dbac 100644 --- a/libstdc++-v3/include/bits/valarray_after.h +++ b/libstdc++-v3/include/bits/valarray_after.h @@ -41,35 +41,35 @@ namespace std { - + // // gslice_array closure. // template<class _Dom> class _GBase { public: typedef typename _Dom::value_type value_type; - + _GBase (const _Dom& __e, const valarray<size_t>& __i) : _M_expr (__e), _M_index(__i) {} value_type operator[] (size_t __i) const { return _M_expr[_M_index[__i]]; } size_t size () const { return _M_index.size(); } - + private: const _Dom& _M_expr; const valarray<size_t>& _M_index; }; - + template<typename _Tp> class _GBase<_Array<_Tp> > { public: typedef _Tp value_type; - + _GBase (_Array<_Tp> __a, const valarray<size_t>& __i) : _M_array (__a), _M_index(__i) {} value_type operator[] (size_t __i) const { return _M_array._M_data[_M_index[__i]]; } size_t size () const { return _M_index.size(); } - + private: const _Array<_Tp> _M_array; const valarray<size_t>& _M_index; @@ -104,9 +104,9 @@ namespace std value_type operator[] (size_t __i) const { return _M_expr[_M_index[__i]]; } size_t size() const { return _M_index.size(); } - + private: - const _Dom& _M_expr; + const _Dom& _M_expr; const valarray<size_t>& _M_index; }; @@ -129,23 +129,23 @@ namespace std // // class _Expr - // - template<class _Clos, typename _Tp> + // + template<class _Clos, typename _Tp> class _Expr { public: typedef _Tp value_type; - + _Expr(const _Clos&); - + const _Clos& operator()() const; - + value_type operator[](size_t) const; valarray<value_type> operator[](slice) const; valarray<value_type> operator[](const gslice&) const; valarray<value_type> operator[](const valarray<bool>&) const; valarray<value_type> operator[](const valarray<size_t>&) const; - + _Expr<_UnClos<__unary_plus,std::_Expr,_Clos>, value_type> operator+() const; @@ -160,7 +160,7 @@ namespace std size_t size() const; value_type sum() const; - + valarray<value_type> shift(int) const; valarray<value_type> cshift(int) const; @@ -169,15 +169,15 @@ namespace std valarray<value_type> apply(value_type (*)(const value_type&)) const; valarray<value_type> apply(value_type (*)(value_type)) const; - + private: const _Clos _M_closure; }; - + template<class _Clos, typename _Tp> inline _Expr<_Clos,_Tp>::_Expr(const _Clos& __c) : _M_closure(__c) {} - + template<class _Clos, typename _Tp> inline const _Clos& _Expr<_Clos,_Tp>::operator()() const @@ -192,22 +192,22 @@ namespace std inline valarray<_Tp> _Expr<_Clos,_Tp>::operator[](slice __s) const { return _M_closure[__s]; } - + template<class _Clos, typename _Tp> inline valarray<_Tp> _Expr<_Clos,_Tp>::operator[](const gslice& __gs) const { return _M_closure[__gs]; } - + template<class _Clos, typename _Tp> inline valarray<_Tp> _Expr<_Clos,_Tp>::operator[](const valarray<bool>& __m) const { return _M_closure[__m]; } - + template<class _Clos, typename _Tp> inline valarray<_Tp> _Expr<_Clos,_Tp>::operator[](const valarray<size_t>& __i) const { return _M_closure[__i]; } - + template<class _Clos, typename _Tp> inline size_t _Expr<_Clos,_Tp>::size() const { return _M_closure.size (); } @@ -226,7 +226,7 @@ namespace std inline valarray<_Tp> _Expr<_Clos, _Tp>::apply(_Tp __f(const _Tp&)) const { return valarray<_Tp>(_M_closure).apply(__f); } - + template<class _Clos, typename _Tp> inline valarray<_Tp> _Expr<_Clos, _Tp>::apply(_Tp __f(_Tp)) const @@ -238,9 +238,9 @@ namespace std _Expr<_Clos,_Tp>::sum() const { size_t __n = _M_closure.size(); - if (__n == 0) + if (__n == 0) return _Tp(); - else + else { _Tp __s = _M_closure[--__n]; while (__n != 0) @@ -258,7 +258,7 @@ namespace std inline _Tp _Expr<_Clos, _Tp>::max() const { return __valarray_max(_M_closure); } - + template<class _Dom, typename _Tp> inline _Expr<_UnClos<__logical_not,_Expr,_Dom>, bool> _Expr<_Dom,_Tp>::operator!() const @@ -386,14 +386,14 @@ operator _Op(const valarray<typename _Dom::value_type>& __v, \ _DEFINE_EXPR_UNARY_FUNCTION(abs) _DEFINE_EXPR_UNARY_FUNCTION(cos) _DEFINE_EXPR_UNARY_FUNCTION(acos) - _DEFINE_EXPR_UNARY_FUNCTION(cosh) + _DEFINE_EXPR_UNARY_FUNCTION(cosh) _DEFINE_EXPR_UNARY_FUNCTION(sin) _DEFINE_EXPR_UNARY_FUNCTION(asin) - _DEFINE_EXPR_UNARY_FUNCTION(sinh) + _DEFINE_EXPR_UNARY_FUNCTION(sinh) _DEFINE_EXPR_UNARY_FUNCTION(tan) _DEFINE_EXPR_UNARY_FUNCTION(tanh) _DEFINE_EXPR_UNARY_FUNCTION(atan) - _DEFINE_EXPR_UNARY_FUNCTION(exp) + _DEFINE_EXPR_UNARY_FUNCTION(exp) _DEFINE_EXPR_UNARY_FUNCTION(log) _DEFINE_EXPR_UNARY_FUNCTION(log10) _DEFINE_EXPR_UNARY_FUNCTION(sqrt) diff --git a/libstdc++-v3/include/bits/valarray_array.h b/libstdc++-v3/include/bits/valarray_array.h index edaf2120eee..e18e8e8e9e8 100644 --- a/libstdc++-v3/include/bits/valarray_array.h +++ b/libstdc++-v3/include/bits/valarray_array.h @@ -51,12 +51,12 @@ namespace std // // Helper functions on raw pointers // - + // We get memory by the old fashion way inline void* __valarray_get_memory(size_t __n) { return operator new(__n); } - + template<typename _Tp> inline _Tp*__restrict__ __valarray_get_storage(size_t __n) @@ -98,7 +98,7 @@ namespace std _Array_default_ctor<_Tp, __is_fundamental<_Tp>::_M_type>:: _S_do_it(__b, __e); } - + // Turn a raw-memory into an array of _Tp filled with __t // This is the required in valarray<T> v(n, t). Also // used in valarray<>::resize(). @@ -196,13 +196,13 @@ namespace std if (!__is_fundamental<_Tp>::_M_type) while (__b != __e) { __b->~_Tp(); ++__b; } } - + // Fill a plain array __a[<__n>] with __t template<typename _Tp> inline void __valarray_fill (_Tp* __restrict__ __a, size_t __n, const _Tp& __t) { while (__n--) *__a++ = __t; } - + // fill strided array __a[<__n-1 : __s>] with __t template<typename _Tp> inline void @@ -216,7 +216,7 @@ namespace std __valarray_fill(_Tp* __restrict__ __a, const size_t* __restrict__ __i, size_t __n, const _Tp& __t) { for (size_t __j=0; __j<__n; ++__j, ++__i) __a[*__i] = __t; } - + // copy plain array __a[<__n>] in __b[<__n>] // For non-fundamental types, it is wrong to say 'memcpy()' template<typename _Tp, bool> @@ -224,7 +224,7 @@ namespace std { inline static void _S_do_it(const _Tp* __restrict__ __a, size_t __n, _Tp* __restrict__ __b) - { while (__n--) *__b++ = *__a++; } + { while (__n--) *__b++ = *__a++; } }; template<typename _Tp> @@ -270,7 +270,7 @@ namespace std __dst[__i * __s2] = __src [ __i * __s1]; } - + // Copy an indexed array __a[__i[<__n>]] in plain array __b[<__n>] template<typename _Tp> inline void @@ -341,7 +341,7 @@ namespace std } return __r; } - + template<typename _Ta> inline typename _Ta::value_type __valarray_max(const _Ta& __a) @@ -357,13 +357,13 @@ namespace std } return __r; } - + // // Helper class _Array, first layer of valarray abstraction. // All operations on valarray should be forwarded to this class // whenever possible. -- gdr // - + template<typename _Tp> struct _Array { @@ -376,20 +376,20 @@ namespace std _Tp* const __restrict__ _M_data; }; - + template<typename _Tp> inline void __valarray_fill (_Array<_Tp> __a, size_t __n, const _Tp& __t) { std::__valarray_fill (__a._M_data, __n, __t); } - + template<typename _Tp> inline void __valarray_fill (_Array<_Tp> __a, size_t __n, size_t __s, const _Tp& __t) { std::__valarray_fill (__a._M_data, __n, __s, __t); } - + template<typename _Tp> inline void - __valarray_fill (_Array<_Tp> __a, _Array<size_t> __i, + __valarray_fill (_Array<_Tp> __a, _Array<size_t> __i, size_t __n, const _Tp& __t) { std::__valarray_fill (__a._M_data, __i._M_data, __n, __t); } @@ -398,7 +398,7 @@ namespace std inline void __valarray_copy(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b) { std::__valarray_copy(__a._M_data, __n, __b._M_data); } - + // Copy strided array __a[<__n : __s>] in plain __b[<__n>] template<typename _Tp> inline void @@ -419,18 +419,18 @@ namespace std _Array<_Tp> __b, size_t __s2) { std::__valarray_copy(__a._M_data, __n, __s1, __b._M_data, __s2); } - + // Copy an indexed array __a[__i[<__n>]] in plain array __b[<__n>] template<typename _Tp> inline void - __valarray_copy(_Array<_Tp> __a, _Array<size_t> __i, + __valarray_copy(_Array<_Tp> __a, _Array<size_t> __i, _Array<_Tp> __b, size_t __n) { std::__valarray_copy(__a._M_data, __i._M_data, __b._M_data, __n); } - + // Copy a plain array __a[<__n>] in an indexed array __b[__i[<__n>]] template<typename _Tp> inline void - __valarray_copy(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b, + __valarray_copy(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b, _Array<size_t> __i) { std::__valarray_copy(__a._M_data, __n, __b._M_data, __i._M_data); } @@ -454,14 +454,14 @@ namespace std template<typename _Tp> inline _Array<_Tp>::_Array (_Tp* const __restrict__ __p) : _M_data (__p) {} - + template<typename _Tp> - inline _Array<_Tp>::_Array (const valarray<_Tp>& __v) + inline _Array<_Tp>::_Array (const valarray<_Tp>& __v) : _M_data (__v._M_data) {} - + template<typename _Tp> inline - _Array<_Tp>::_Array (const _Tp* __restrict__ __b, size_t __s) + _Array<_Tp>::_Array (const _Tp* __restrict__ __b, size_t __s) : _M_data(__valarray_get_storage<_Tp>(__s)) { std::__valarray_copy_construct(__b, __s, _M_data); } @@ -490,7 +490,7 @@ _Array_augmented_##_Name (_Array<_Tp> __a, size_t __n, _Array<_Tp> __b) \ \ template<typename _Tp, class _Dom> \ void \ -_Array_augmented_##_Name (_Array<_Tp> __a, \ +_Array_augmented_##_Name (_Array<_Tp> __a, \ const _Expr<_Dom,_Tp>& __e, size_t __n) \ { \ _Tp* __p (__a._M_data); \ @@ -499,9 +499,9 @@ _Array_augmented_##_Name (_Array<_Tp> __a, \ \ template<typename _Tp> \ inline void \ -_Array_augmented_##_Name (_Array<_Tp> __a, size_t __n, size_t __s, \ +_Array_augmented_##_Name (_Array<_Tp> __a, size_t __n, size_t __s, \ _Array<_Tp> __b) \ -{ \ +{ \ _Tp* __q (__b._M_data); \ for (_Tp* __p=__a._M_data; __p<__a._M_data+__s*__n; __p+=__s, ++__q) \ *__p _Op##= *__q; \ @@ -509,7 +509,7 @@ _Array_augmented_##_Name (_Array<_Tp> __a, size_t __n, size_t __s, \ \ template<typename _Tp> \ inline void \ -_Array_augmented_##_Name (_Array<_Tp> __a, _Array<_Tp> __b, \ +_Array_augmented_##_Name (_Array<_Tp> __a, _Array<_Tp> __b, \ size_t __n, size_t __s) \ { \ _Tp* __q (__b._M_data); \ @@ -552,7 +552,7 @@ _Array_augmented_##_Name (_Array<_Tp> __a, _Array<size_t> __i, \ const _Expr<_Dom, _Tp>& __e, size_t __n) \ { \ size_t* __j (__i._M_data); \ - for (size_t __k=0; __k<__n; ++__k, ++__j) \ + for (size_t __k=0; __k<__n; ++__k, ++__j) \ __a._M_data[*__j] _Op##= __e[__k]; \ } \ \ @@ -611,15 +611,15 @@ _Array_augmented_##_Name (_Array<_Tp> __a, _Array<bool> __m, \ _DEFINE_ARRAY_FUNCTION(%, __modulus) _DEFINE_ARRAY_FUNCTION(^, __bitwise_xor) _DEFINE_ARRAY_FUNCTION(|, __bitwise_or) - _DEFINE_ARRAY_FUNCTION(&, __bitwise_and) + _DEFINE_ARRAY_FUNCTION(&, __bitwise_and) _DEFINE_ARRAY_FUNCTION(<<, __shift_left) _DEFINE_ARRAY_FUNCTION(>>, __shift_right) -#undef _DEFINE_VALARRAY_FUNCTION +#undef _DEFINE_VALARRAY_FUNCTION } // namespace std #ifndef _GLIBCXX_EXPORT_TEMPLATE -# include <bits/valarray_array.tcc> +# include <bits/valarray_array.tcc> #endif - + #endif /* _ARRAY_H */ diff --git a/libstdc++-v3/include/bits/valarray_array.tcc b/libstdc++-v3/include/bits/valarray_array.tcc index 289001cf792..cf660346472 100644 --- a/libstdc++-v3/include/bits/valarray_array.tcc +++ b/libstdc++-v3/include/bits/valarray_array.tcc @@ -29,21 +29,21 @@ // Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr> -#ifndef _VALARRAY_ARRAY_TCC +#ifndef _VALARRAY_ARRAY_TCC #define _VALARRAY_ARRAY_TCC 1 namespace std { template<typename _Tp> void - __valarray_fill(_Array<_Tp> __a, size_t __n, _Array<bool> __m, + __valarray_fill(_Array<_Tp> __a, size_t __n, _Array<bool> __m, const _Tp& __t) { _Tp* __p = __a._M_data; bool* __ok (__m._M_data); - for (size_t __i=0; __i < __n; ++__i, ++__ok, ++__p) + for (size_t __i=0; __i < __n; ++__i, ++__ok, ++__p) { - while (!*__ok) + while (!*__ok) { ++__ok; ++__p; @@ -51,18 +51,18 @@ namespace std *__p = __t; } } - + template<typename _Tp> void - __valarray_copy(_Array<_Tp> __a, _Array<bool> __m, _Array<_Tp> __b, + __valarray_copy(_Array<_Tp> __a, _Array<bool> __m, _Array<_Tp> __b, size_t __n) { _Tp* __p (__a._M_data); bool* __ok (__m._M_data); - for (_Tp* __q = __b._M_data; __q < __b._M_data + __n; - ++__q, ++__ok, ++__p) + for (_Tp* __q = __b._M_data; __q < __b._M_data + __n; + ++__q, ++__ok, ++__p) { - while (! *__ok) + while (! *__ok) { ++__ok; ++__p; @@ -73,15 +73,15 @@ namespace std template<typename _Tp> void - __valarray_copy(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b, + __valarray_copy(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b, _Array<bool> __m) { _Tp* __q (__b._M_data); bool* __ok (__m._M_data); - for (_Tp* __p = __a._M_data; __p < __a._M_data+__n; - ++__p, ++__ok, ++__q) + for (_Tp* __p = __a._M_data; __p < __a._M_data+__n; + ++__p, ++__ok, ++__q) { - while (! *__ok) + while (! *__ok) { ++__ok; ++__q; @@ -95,40 +95,40 @@ namespace std __valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n, _Array<_Tp> __a) { _Tp* __p (__a._M_data); - for (size_t __i = 0; __i < __n; ++__i, ++__p) + for (size_t __i = 0; __i < __n; ++__i, ++__p) *__p = __e[__i]; } template<typename _Tp, class _Dom> void - __valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n, + __valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n, _Array<_Tp> __a, size_t __s) { _Tp* __p (__a._M_data); - for (size_t __i = 0; __i < __n; ++__i, __p += __s) + for (size_t __i = 0; __i < __n; ++__i, __p += __s) *__p = __e[__i]; } template<typename _Tp, class _Dom> void - __valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n, + __valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n, _Array<_Tp> __a, _Array<size_t> __i) { size_t* __j (__i._M_data); - for (size_t __k = 0; __k < __n; ++__k, ++__j) + for (size_t __k = 0; __k < __n; ++__k, ++__j) __a._M_data[*__j] = __e[__k]; } template<typename _Tp, class _Dom> void - __valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n, + __valarray_copy(const _Expr<_Dom, _Tp>& __e, size_t __n, _Array<_Tp> __a, _Array<bool> __m) { bool* __ok (__m._M_data); _Tp* __p (__a._M_data); - for (size_t __i = 0; __i < __n; ++__i, ++__ok, ++__p) + for (size_t __i = 0; __i < __n; ++__i, ++__ok, ++__p) { - while (! *__ok) + while (! *__ok) { ++__ok; ++__p; @@ -136,7 +136,7 @@ namespace std *__p = __e[__i]; } } - + template<typename _Tp, class _Dom> void @@ -144,7 +144,7 @@ namespace std _Array<_Tp> __a) { _Tp* __p (__a._M_data); - for (size_t __i = 0; __i < __n; ++__i, ++__p) + for (size_t __i = 0; __i < __n; ++__i, ++__p) new (__p) _Tp(__e[__i]); } @@ -158,7 +158,7 @@ namespace std bool* __ok (__m._M_data); for (_Tp* __q = __b._M_data; __q < __b._M_data+__n; ++__q, ++__ok, ++__p) { - while (! *__ok) + while (! *__ok) { ++__ok; ++__p; diff --git a/libstdc++-v3/include/bits/valarray_before.h b/libstdc++-v3/include/bits/valarray_before.h index 775d150eff1..263ac2f0e22 100644 --- a/libstdc++-v3/include/bits/valarray_before.h +++ b/libstdc++-v3/include/bits/valarray_before.h @@ -51,7 +51,7 @@ namespace std // At some point we use partial specialization to remove one level // template nesting due to _Expr<> // - + // This class is NOT defined. It doesn't need to. template<typename _Tp1, typename _Tp2> class _Constant; @@ -386,11 +386,11 @@ namespace std // template<typename _Dom, typename _Arg> - class _FunBase + class _FunBase { public: typedef typename _Dom::value_type value_type; - + _FunBase(const _Dom& __e, value_type __f(_Arg)) : _M_expr(__e), _M_func(__f) {} @@ -405,12 +405,12 @@ namespace std }; template<class _Dom> - struct _ValFunClos<_Expr,_Dom> : _FunBase<_Dom, typename _Dom::value_type> + struct _ValFunClos<_Expr,_Dom> : _FunBase<_Dom, typename _Dom::value_type> { typedef _FunBase<_Dom, typename _Dom::value_type> _Base; typedef typename _Base::value_type value_type; typedef value_type _Tp; - + _ValFunClos(const _Dom& __e, _Tp __f(_Tp)) : _Base(__e, __f) {} }; @@ -419,32 +419,32 @@ namespace std { typedef _FunBase<valarray<_Tp>, _Tp> _Base; typedef _Tp value_type; - + _ValFunClos(const valarray<_Tp>& __v, _Tp __f(_Tp)) : _Base(__v, __f) {} }; template<class _Dom> struct _RefFunClos<_Expr,_Dom> : - _FunBase<_Dom, const typename _Dom::value_type&> + _FunBase<_Dom, const typename _Dom::value_type&> { typedef _FunBase<_Dom, const typename _Dom::value_type&> _Base; typedef typename _Base::value_type value_type; typedef value_type _Tp; - + _RefFunClos(const _Dom& __e, _Tp __f(const _Tp&)) : _Base(__e, __f) {} }; template<typename _Tp> - struct _RefFunClos<_ValArray,_Tp> : _FunBase<valarray<_Tp>, const _Tp&> + struct _RefFunClos<_ValArray,_Tp> : _FunBase<valarray<_Tp>, const _Tp&> { typedef _FunBase<valarray<_Tp>, const _Tp&> _Base; typedef _Tp value_type; - + _RefFunClos(const valarray<_Tp>& __v, _Tp __f(const _Tp&)) : _Base(__v, __f) {} }; - + // // Unary expression closure. // @@ -473,17 +473,17 @@ namespace std typedef _Dom _Arg; typedef _UnBase<_Oper, _Dom> _Base; typedef typename _Base::value_type value_type; - + _UnClos(const _Arg& __e) : _Base(__e) {} }; template<class _Oper, typename _Tp> - struct _UnClos<_Oper, _ValArray, _Tp> : _UnBase<_Oper, valarray<_Tp> > + struct _UnClos<_Oper, _ValArray, _Tp> : _UnBase<_Oper, valarray<_Tp> > { typedef valarray<_Tp> _Arg; typedef _UnBase<_Oper, valarray<_Tp> > _Base; typedef typename _Base::value_type value_type; - + _UnClos(const _Arg& __e) : _Base(__e) {} }; @@ -493,7 +493,7 @@ namespace std // template<class _Oper, class _FirstArg, class _SecondArg> - class _BinBase + class _BinBase { public: typedef typename _FirstArg::value_type _Vt; @@ -501,12 +501,12 @@ namespace std _BinBase(const _FirstArg& __e1, const _SecondArg& __e2) : _M_expr1(__e1), _M_expr2(__e2) {} - + value_type operator[](size_t __i) const { return _Oper()(_M_expr1[__i], _M_expr2[__i]); } size_t size() const { return _M_expr1.size(); } - + private: const _FirstArg& _M_expr1; const _SecondArg& _M_expr2; @@ -545,27 +545,27 @@ namespace std value_type operator[](size_t __i) const { return _Oper()(_M_expr1, _M_expr2[__i]); } - + size_t size() const { return _M_expr2.size(); } private: const _Vt& _M_expr1; const _Clos& _M_expr2; }; - + template<class _Oper, class _Dom1, class _Dom2> struct _BinClos<_Oper, _Expr, _Expr, _Dom1, _Dom2> - : _BinBase<_Oper,_Dom1,_Dom2> + : _BinBase<_Oper,_Dom1,_Dom2> { typedef _BinBase<_Oper,_Dom1,_Dom2> _Base; typedef typename _Base::value_type value_type; - + _BinClos(const _Dom1& __e1, const _Dom2& __e2) : _Base(__e1, __e2) {} }; template<class _Oper, typename _Tp> struct _BinClos<_Oper,_ValArray,_ValArray,_Tp,_Tp> - : _BinBase<_Oper,valarray<_Tp>,valarray<_Tp> > + : _BinBase<_Oper,valarray<_Tp>,valarray<_Tp> > { typedef _BinBase<_Oper,valarray<_Tp>,valarray<_Tp> > _Base; typedef _Tp value_type; @@ -576,70 +576,70 @@ namespace std template<class _Oper, class _Dom> struct _BinClos<_Oper,_Expr,_ValArray,_Dom,typename _Dom::value_type> - : _BinBase<_Oper,_Dom,valarray<typename _Dom::value_type> > + : _BinBase<_Oper,_Dom,valarray<typename _Dom::value_type> > { typedef typename _Dom::value_type _Tp; typedef _BinBase<_Oper,_Dom,valarray<_Tp> > _Base; typedef typename _Base::value_type value_type; - + _BinClos(const _Dom& __e1, const valarray<_Tp>& __e2) : _Base(__e1, __e2) {} }; template<class _Oper, class _Dom> struct _BinClos<_Oper,_ValArray,_Expr,typename _Dom::value_type,_Dom> - : _BinBase<_Oper,valarray<typename _Dom::value_type>,_Dom> + : _BinBase<_Oper,valarray<typename _Dom::value_type>,_Dom> { typedef typename _Dom::value_type _Tp; typedef _BinBase<_Oper,valarray<_Tp>,_Dom> _Base; typedef typename _Base::value_type value_type; - + _BinClos(const valarray<_Tp>& __e1, const _Dom& __e2) : _Base(__e1, __e2) {} }; template<class _Oper, class _Dom> struct _BinClos<_Oper,_Expr,_Constant,_Dom,typename _Dom::value_type> - : _BinBase2<_Oper,_Dom> + : _BinBase2<_Oper,_Dom> { typedef typename _Dom::value_type _Tp; typedef _BinBase2<_Oper,_Dom> _Base; typedef typename _Base::value_type value_type; - + _BinClos(const _Dom& __e1, const _Tp& __e2) : _Base(__e1, __e2) {} }; template<class _Oper, class _Dom> struct _BinClos<_Oper,_Constant,_Expr,typename _Dom::value_type,_Dom> - : _BinBase1<_Oper,_Dom> + : _BinBase1<_Oper,_Dom> { typedef typename _Dom::value_type _Tp; typedef _BinBase1<_Oper,_Dom> _Base; typedef typename _Base::value_type value_type; - + _BinClos(const _Tp& __e1, const _Dom& __e2) : _Base(__e1, __e2) {} }; - + template<class _Oper, typename _Tp> struct _BinClos<_Oper,_ValArray,_Constant,_Tp,_Tp> - : _BinBase2<_Oper,valarray<_Tp> > + : _BinBase2<_Oper,valarray<_Tp> > { typedef _BinBase2<_Oper,valarray<_Tp> > _Base; typedef typename _Base::value_type value_type; - + _BinClos(const valarray<_Tp>& __v, const _Tp& __t) : _Base(__v, __t) {} }; template<class _Oper, typename _Tp> struct _BinClos<_Oper,_Constant,_ValArray,_Tp,_Tp> - : _BinBase1<_Oper,valarray<_Tp> > + : _BinBase1<_Oper,valarray<_Tp> > { typedef _BinBase1<_Oper,valarray<_Tp> > _Base; typedef typename _Base::value_type value_type; - + _BinClos(const _Tp& __t, const valarray<_Tp>& __v) : _Base(__t, __v) {} }; - + // // slice_array closure. @@ -679,7 +679,7 @@ namespace std template<class _Dom> struct _SClos<_Expr,_Dom> : _SBase<_Dom> { typedef _SBase<_Dom> _Base; typedef typename _Base::value_type value_type; - + _SClos (const _Dom& __e, const slice& __s) : _Base (__e, __s) {} }; diff --git a/libstdc++-v3/include/bits/vector.tcc b/libstdc++-v3/include/bits/vector.tcc index ee7e85c5198..207367cf59f 100644 --- a/libstdc++-v3/include/bits/vector.tcc +++ b/libstdc++-v3/include/bits/vector.tcc @@ -84,7 +84,7 @@ namespace __gnu_norm this->_M_end_of_storage = this->_M_start + __n; } } - + template<typename _Tp, typename _Alloc> typename vector<_Tp,_Alloc>::iterator vector<_Tp,_Alloc>:: @@ -100,7 +100,7 @@ namespace __gnu_norm _M_insert_aux(__position, __x); return begin() + __n; } - + template<typename _Tp, typename _Alloc> typename vector<_Tp,_Alloc>::iterator vector<_Tp,_Alloc>:: @@ -112,7 +112,7 @@ namespace __gnu_norm std::_Destroy(this->_M_finish); return __position; } - + template<typename _Tp, typename _Alloc> typename vector<_Tp,_Alloc>::iterator vector<_Tp,_Alloc>:: @@ -123,7 +123,7 @@ namespace __gnu_norm this->_M_finish = this->_M_finish - (__last - __first); return __first; } - + template<typename _Tp, typename _Alloc> vector<_Tp,_Alloc>& vector<_Tp,_Alloc>:: @@ -155,7 +155,7 @@ namespace __gnu_norm } return *this; } - + template<typename _Tp, typename _Alloc> void vector<_Tp,_Alloc>:: @@ -175,7 +175,7 @@ namespace __gnu_norm else erase(fill_n(begin(), __n, __val), end()); } - + template<typename _Tp, typename _Alloc> template<typename _InputIterator> void vector<_Tp,_Alloc>:: @@ -189,7 +189,7 @@ namespace __gnu_norm else insert(end(), __first, __last); } - + template<typename _Tp, typename _Alloc> template<typename _ForwardIterator> void vector<_Tp,_Alloc>:: @@ -197,7 +197,7 @@ namespace __gnu_norm forward_iterator_tag) { size_type __len = std::distance(__first, __last); - + if (__len > capacity()) { pointer __tmp(_M_allocate_and_copy(__len, __first, __last)); @@ -221,7 +221,7 @@ namespace __gnu_norm this->_M_finish = std::uninitialized_copy(__mid, __last, this->_M_finish); } } - + template<typename _Tp, typename _Alloc> void vector<_Tp,_Alloc>:: @@ -276,7 +276,7 @@ namespace __gnu_norm { if (__n != 0) { - if (size_type(this->_M_end_of_storage - this->_M_finish) >= __n) + if (size_type(this->_M_end_of_storage - this->_M_finish) >= __n) { value_type __x_copy = __x; const size_type __elems_after = end() - __position; @@ -312,7 +312,7 @@ namespace __gnu_norm __new_finish = std::uninitialized_copy(begin(), __position, __new_start); __new_finish = std::uninitialized_fill_n(__new_finish, __n, __x); - __new_finish = std::uninitialized_copy(__position, end(), + __new_finish = std::uninitialized_copy(__position, end(), __new_finish); } catch(...) @@ -330,7 +330,7 @@ namespace __gnu_norm } } } - + template<typename _Tp, typename _Alloc> template<typename _InputIterator> void vector<_Tp,_Alloc>:: @@ -344,11 +344,11 @@ namespace __gnu_norm ++__pos; } } - + template<typename _Tp, typename _Alloc> template<typename _ForwardIterator> void vector<_Tp,_Alloc>:: - _M_range_insert(iterator __position,_ForwardIterator __first, + _M_range_insert(iterator __position,_ForwardIterator __first, _ForwardIterator __last, forward_iterator_tag) { if (__first != __last) @@ -388,7 +388,7 @@ namespace __gnu_norm { __new_finish = std::uninitialized_copy(iterator(this->_M_start), __position, __new_start); - __new_finish = std::uninitialized_copy(__first, __last, + __new_finish = std::uninitialized_copy(__first, __last, __new_finish); __new_finish = std::uninitialized_copy(__position, iterator(this->_M_finish), |