diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 9d46458f3d4..600e2a8f1b7 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,14 @@ +2009-09-16 Johannes Singler + + * include/parallel/base.h (_PseudoSequenceIterator, _PseudoSequence): + Replace redundant _Self. + * include/parallel/iterator.h (_IteratorPair, _IteratorTriple): + Replace redundant _Self. + * include/parallel/algo.h: Correct accidental _Self in comments. + * include/parallel/losertree.h: Likewise. + * include/parallel/multiway_merge.h: Likewise. + * include/parallel/random_shuffle.h: Likewise. + 2009-09-16 Johannes Singler * include/parallel/algobase.h: Uglify internal identifiers. diff --git a/libstdc++-v3/include/parallel/algo.h b/libstdc++-v3/include/parallel/algo.h index 7f32036aec6..cb042215696 100644 --- a/libstdc++-v3/include/parallel/algo.h +++ b/libstdc++-v3/include/parallel/algo.h @@ -224,7 +224,7 @@ namespace __parallel _BinaryPredicate __comp, __gnu_parallel::sequential_tag) { return _GLIBCXX_STD_P::find_first_of(__begin1, __end1, __begin2, __end2, __comp); } - // Sequential fallback for input iterator _Self + // Sequential fallback for input iterator type template inline _IIter @@ -250,7 +250,7 @@ namespace __parallel <_ForwardIterator>(__begin2, __end2)).first; } - // Sequential fallback for input iterator _Self + // Sequential fallback for input iterator type template diff --git a/libstdc++-v3/include/parallel/base.h b/libstdc++-v3/include/parallel/base.h index e09f05c76f8..5edc213853d 100644 --- a/libstdc++-v3/include/parallel/base.h +++ b/libstdc++-v3/include/parallel/base.h @@ -341,8 +341,6 @@ template typedef _DifferenceTp _DifferenceType; private: - typedef _PseudoSequenceIterator<_Tp, _DifferenceTp> _Self; - const _Tp& _M_val; _DifferenceType _M_pos; @@ -351,7 +349,7 @@ template : _M_val(_M_val), _M_pos(_M_pos) { } // Pre-increment operator. - _Self& + _PseudoSequenceIterator& operator++() { ++_M_pos; @@ -359,9 +357,9 @@ template } // Post-increment operator. - const _Self + const _PseudoSequenceIterator operator++(int) - { return _Self(_M_pos++); } + { return _PseudoSequenceIterator(_M_pos++); } const _Tp& operator*() const @@ -372,15 +370,15 @@ template { return _M_val; } bool - operator==(const _Self& __i2) + operator==(const _PseudoSequenceIterator& __i2) { return _M_pos == __i2._M_pos; } _DifferenceType - operator!=(const _Self& __i2) + operator!=(const _PseudoSequenceIterator& __i2) { return _M_pos != __i2._M_pos; } _DifferenceType - operator-(const _Self& __i2) + operator-(const _PseudoSequenceIterator& __i2) { return _M_pos - __i2._M_pos; } }; @@ -393,8 +391,6 @@ template template class _PseudoSequence { - typedef _PseudoSequence<_Tp, _DifferenceTp> _Self; - public: typedef _DifferenceTp _DifferenceType; diff --git a/libstdc++-v3/include/parallel/iterator.h b/libstdc++-v3/include/parallel/iterator.h index 1baade860c9..0b7cbf2e876 100644 --- a/libstdc++-v3/include/parallel/iterator.h +++ b/libstdc++-v3/include/parallel/iterator.h @@ -44,7 +44,6 @@ namespace __gnu_parallel class _IteratorPair : public std::pair<_Iterator1, _Iterator2> { private: - typedef _IteratorPair<_Iterator1, _Iterator2, _IteratorCategory> _Self; typedef std::pair<_Iterator1, _Iterator2> _Base; public: @@ -53,8 +52,8 @@ namespace __gnu_parallel typedef std::iterator_traits<_Iterator1> _TraitsType; typedef typename _TraitsType::difference_type difference_type; - typedef _Self* pointer; - typedef _Self& reference; + typedef _IteratorPair* pointer; + typedef _IteratorPair& reference; _IteratorPair() { } @@ -62,7 +61,7 @@ namespace __gnu_parallel : _Base(__first, __second) { } // Pre-increment operator. - _Self& + _IteratorPair& operator++() { ++_Base::first; @@ -71,12 +70,12 @@ namespace __gnu_parallel } // Post-increment operator. - const _Self + const _IteratorPair operator++(int) - { return _Self(_Base::first++, _Base::second++); } + { return _IteratorPair(_Base::first++, _Base::second++); } // Pre-decrement operator. - _Self& + _IteratorPair& operator--() { --_Base::first; @@ -85,28 +84,28 @@ namespace __gnu_parallel } // Post-decrement operator. - const _Self + const _IteratorPair operator--(int) - { return _Self(_Base::first--, _Base::second--); } + { return _IteratorPair(_Base::first--, _Base::second--); } // Type conversion. operator _Iterator2() const { return _Base::second; } - _Self& - operator=(const _Self& __other) + _IteratorPair& + operator=(const _IteratorPair& __other) { _Base::first = __other.first; _Base::second = __other.second; return *this; } - _Self + _IteratorPair operator+(difference_type __delta) const - { return _Self(_Base::first + __delta, _Base::second + __delta); } + { return _IteratorPair(_Base::first + __delta, _Base::second + __delta); } difference_type - operator-(const _Self& __other) const + operator-(const _IteratorPair& __other) const { return _Base::first - __other.first; } }; @@ -118,17 +117,13 @@ namespace __gnu_parallel typename _IteratorCategory> class _IteratorTriple { - private: - typedef _IteratorTriple<_Iterator1, _Iterator2, _Iterator3, - _IteratorCategory> _Self; - public: typedef _IteratorCategory iterator_category; typedef void value_type; typedef typename std::iterator_traits<_Iterator1>::difference_type difference_type; - typedef _Self* pointer; - typedef _Self& reference; + typedef _IteratorTriple* pointer; + typedef _IteratorTriple& reference; _Iterator1 __first; _Iterator2 __second; @@ -145,7 +140,7 @@ namespace __gnu_parallel } // Pre-increment operator. - _Self& + _IteratorTriple& operator++() { ++__first; @@ -155,12 +150,12 @@ namespace __gnu_parallel } // Post-increment operator. - const _Self + const _IteratorTriple operator++(int) - { return _Self(__first++, __second++, __third++); } + { return _IteratorTriple(__first++, __second++, __third++); } // Pre-decrement operator. - _Self& + _IteratorTriple& operator--() { --__first; @@ -170,16 +165,16 @@ namespace __gnu_parallel } // Post-decrement operator. - const _Self + const _IteratorTriple operator--(int) - { return _Self(__first--, __second--, __third--); } + { return _IteratorTriple(__first--, __second--, __third--); } // Type conversion. operator _Iterator3() const { return __third; } - _Self& - operator=(const _Self& __other) + _IteratorTriple& + operator=(const _IteratorTriple& __other) { __first = __other.__first; __second = __other.__second; @@ -187,12 +182,12 @@ namespace __gnu_parallel return *this; } - _Self + _IteratorTriple operator+(difference_type __delta) const - { return _Self(__first + __delta, __second + __delta, __third + __delta); } + { return _IteratorTriple(__first + __delta, __second + __delta, __third + __delta); } difference_type - operator-(const _Self& __other) const + operator-(const _IteratorTriple& __other) const { return __first - __other.__first; } }; } diff --git a/libstdc++-v3/include/parallel/losertree.h b/libstdc++-v3/include/parallel/losertree.h index b9810257232..b98608d8034 100644 --- a/libstdc++-v3/include/parallel/losertree.h +++ b/libstdc++-v3/include/parallel/losertree.h @@ -50,7 +50,7 @@ namespace __gnu_parallel * inf is not needed due to a better initialization routine. This * is a well-performing variant. * - * @param _Tp the element _Self + * @param _Tp the element type * @param _Compare the comparator to use, defaults to std::less<_Tp> */ template diff --git a/libstdc++-v3/include/parallel/multiway_merge.h b/libstdc++-v3/include/parallel/multiway_merge.h index 0aa661fe6da..bc64db4a94f 100644 --- a/libstdc++-v3/include/parallel/multiway_merge.h +++ b/libstdc++-v3/include/parallel/multiway_merge.h @@ -755,10 +755,10 @@ template< * The field "_M_use_pointer" is used to determine whether to use pointers in * the loser trees or whether to copy the values into the loser tree. * - * The default behavior is to use pointers if the data _Self is 4 times as + * The default behavior is to use pointers if the data type is 4 times as * big as the pointer to it. * - * Specialize for your data _Self to customize the behavior. + * Specialize for your data type to customize the behavior. * * Example: * @@ -770,7 +770,7 @@ template< * struct _LoserTreeTraits * { static const bool _M_use_pointer = true; }; * - * @param _Tp _Self to give the loser tree traits for. + * @param _Tp type to give the loser tree traits for. */ template struct _LoserTreeTraits @@ -778,7 +778,7 @@ struct _LoserTreeTraits /** * @brief True iff to use pointers instead of values in loser trees. * - * The default behavior is to use pointers if the data _Self is four + * The default behavior is to use pointers if the data type is four * times as big as the pointer to it. */ static const bool _M_use_pointer = (sizeof(_Tp) > 4 * sizeof(_Tp*)); @@ -1442,7 +1442,7 @@ template< * @see stable_multiway_merge * * @pre All input sequences must be sorted. - * @pre Target must provide enough space to merge out __length __elements or + * @pre Target must provide enough space to merge out length elements or * the number of elements in all sequences, whichever is smaller. * * @post [__target, return __value) contains merged __elements from the @@ -1450,11 +1450,11 @@ template< * @post return __value - __target = min(__length, number of elements in all * sequences). * - * @param _RAIterPairIterator iterator over __sequence + * @param _RAIterPairIterator iterator over sequence * of pairs of iterators * @param _RAIterOut iterator over target sequence - * @param _DifferenceTp difference _Self for the sequence - * @param _Compare strict weak ordering _Self to compare __elements + * @param _DifferenceTp difference type for the sequence + * @param _Compare strict weak ordering type to compare elements * in sequences * * @param __seqs_begin __begin of sequence __sequence @@ -1809,7 +1809,7 @@ stable_multiway_merge(_RAIterPairIterator __seqs_begin * * * @pre All input sequences must be sorted. - * @pre Target must provide enough space to merge out __length __elements or + * @pre Target must provide enough space to merge out length elements or * the number of elements in all sequences, whichever is smaller. * @pre For each @__c __i, @__c __seqs_begin[__i].second must be the end * marker of the sequence, but also reference the one more __sentinel @@ -1822,11 +1822,11 @@ stable_multiway_merge(_RAIterPairIterator __seqs_begin * * @see stable_multiway_merge_sentinels * - * @param _RAIterPairIterator iterator over __sequence + * @param _RAIterPairIterator iterator over sequence * of pairs of iterators * @param _RAIterOut iterator over target sequence - * @param _DifferenceTp difference _Self for the sequence - * @param _Compare strict weak ordering _Self to compare __elements + * @param _DifferenceTp difference type for the sequence + * @param _Compare strict weak ordering type to compare elements * in sequences * * @param __seqs_begin __begin of sequence __sequence diff --git a/libstdc++-v3/include/parallel/random_shuffle.h b/libstdc++-v3/include/parallel/random_shuffle.h index 5d6bfcec374..77ac639cf62 100644 --- a/libstdc++-v3/include/parallel/random_shuffle.h +++ b/libstdc++-v3/include/parallel/random_shuffle.h @@ -41,7 +41,7 @@ namespace __gnu_parallel { /** @brief Type to hold the index of a bin. * - * Since many variables of this _Self are allocated, it should be + * Since many variables of this type are allocated, it should be * chosen as small as possible. */ typedef unsigned short _BinIndex;