base.h (_PseudoSequenceIterator, [...]): Replace redundant _Self.

2009-09-16  Johannes Singler  <singler@ira.uka.de>

        * 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.

From-SVN: r151743
This commit is contained in:
Johannes Singler 2009-09-16 11:02:15 +00:00 committed by Johannes Singler
parent 9da4af8c07
commit 11b9c936bf
7 changed files with 59 additions and 57 deletions

View File

@ -1,3 +1,14 @@
2009-09-16 Johannes Singler <singler@ira.uka.de>
* 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 <singler@ira.uka.de>
* include/parallel/algobase.h: Uglify internal identifiers.

View File

@ -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<typename _IIter, typename _ForwardIterator,
typename _IteratorTag1, typename _IteratorTag2>
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<typename _IIter, typename _ForwardIterator,
typename _BinaryPredicate, typename _IteratorTag1,
typename _IteratorTag2>

View File

@ -341,8 +341,6 @@ template<typename _Tp, typename _DifferenceTp>
typedef _DifferenceTp _DifferenceType;
private:
typedef _PseudoSequenceIterator<_Tp, _DifferenceTp> _Self;
const _Tp& _M_val;
_DifferenceType _M_pos;
@ -351,7 +349,7 @@ template<typename _Tp, typename _DifferenceTp>
: _M_val(_M_val), _M_pos(_M_pos) { }
// Pre-increment operator.
_Self&
_PseudoSequenceIterator&
operator++()
{
++_M_pos;
@ -359,9 +357,9 @@ template<typename _Tp, typename _DifferenceTp>
}
// 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<typename _Tp, typename _DifferenceTp>
{ 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<typename _Tp, typename _DifferenceTp>
template<typename _Tp, typename _DifferenceTp>
class _PseudoSequence
{
typedef _PseudoSequence<_Tp, _DifferenceTp> _Self;
public:
typedef _DifferenceTp _DifferenceType;

View File

@ -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; }
};
}

View File

@ -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<typename _Tp, typename _Compare>

View File

@ -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<heavyweight_type>
* { 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 <typename _Tp>
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>
*
* @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

View File

@ -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;