base.h (_PseudoSequence): Do not forward declare.

2010-03-22  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/parallel/base.h (_PseudoSequence): Do not forward declare.
	(_VoidFunctor): Remove, unused.
	(__median_of_three_iterators): Take __comp by value.
	(_PseudoSequenceIterator<>::operator++(int)): Do not const qualify
	the return type.
	(_PseudoSequenceIterator<>::operator!=): Fix return type to bool.

From-SVN: r157628
This commit is contained in:
Paolo Carlini 2010-03-22 13:55:11 +00:00 committed by Paolo Carlini
parent 6d7971b832
commit 57fd5f9525
2 changed files with 16 additions and 19 deletions

View File

@ -1,3 +1,12 @@
2010-03-22 Paolo Carlini <paolo.carlini@oracle.com>
* include/parallel/base.h (_PseudoSequence): Do not forward declare.
(_VoidFunctor): Remove, unused.
(__median_of_three_iterators): Take __comp by value.
(_PseudoSequenceIterator<>::operator++(int)): Do not const qualify
the return type.
(_PseudoSequenceIterator<>::operator!=): Fix return type to bool.
2010-03-22 Paolo Carlini <paolo.carlini@oracle.com> 2010-03-22 Paolo Carlini <paolo.carlini@oracle.com>
* include/parallel/base.h (_Less): Use std::less. * include/parallel/base.h (_Less): Use std::less.

View File

@ -297,9 +297,6 @@ namespace __gnu_parallel
struct _Multiplies<_Tp, _Tp, _Tp> struct _Multiplies<_Tp, _Tp, _Tp>
: public std::multiplies<_Tp> { }; : public std::multiplies<_Tp> { };
template<typename _Tp, typename _DifferenceTp>
class _PseudoSequence;
/** @brief _Iterator associated with __gnu_parallel::_PseudoSequence. /** @brief _Iterator associated with __gnu_parallel::_PseudoSequence.
* If features the usual random-access iterator functionality. * If features the usual random-access iterator functionality.
* @param _Tp Sequence _M_value type. * @param _Tp Sequence _M_value type.
@ -311,11 +308,6 @@ namespace __gnu_parallel
public: public:
typedef _DifferenceTp _DifferenceType; typedef _DifferenceTp _DifferenceType;
private:
const _Tp& _M_val;
_DifferenceType _M_pos;
public:
_PseudoSequenceIterator(const _Tp& __val, _DifferenceType __pos) _PseudoSequenceIterator(const _Tp& __val, _DifferenceType __pos)
: _M_val(__val), _M_pos(__pos) { } : _M_val(__val), _M_pos(__pos) { }
@ -328,7 +320,7 @@ namespace __gnu_parallel
} }
// Post-increment operator. // Post-increment operator.
const _PseudoSequenceIterator _PseudoSequenceIterator
operator++(int) operator++(int)
{ return _PseudoSequenceIterator(_M_pos++); } { return _PseudoSequenceIterator(_M_pos++); }
@ -344,13 +336,17 @@ namespace __gnu_parallel
operator==(const _PseudoSequenceIterator& __i2) operator==(const _PseudoSequenceIterator& __i2)
{ return _M_pos == __i2._M_pos; } { return _M_pos == __i2._M_pos; }
_DifferenceType bool
operator!=(const _PseudoSequenceIterator& __i2) operator!=(const _PseudoSequenceIterator& __i2)
{ return _M_pos != __i2._M_pos; } { return _M_pos != __i2._M_pos; }
_DifferenceType _DifferenceType
operator-(const _PseudoSequenceIterator& __i2) operator-(const _PseudoSequenceIterator& __i2)
{ return _M_pos - __i2._M_pos; } { return _M_pos - __i2._M_pos; }
private:
const _Tp& _M_val;
_DifferenceType _M_pos;
}; };
/** @brief Sequence that conceptually consists of multiple copies of /** @brief Sequence that conceptually consists of multiple copies of
@ -390,14 +386,6 @@ namespace __gnu_parallel
_DifferenceType _M_count; _DifferenceType _M_count;
}; };
/** @brief Functor that does nothing */
template<typename _ValueTp>
class _VoidFunctor
{
inline void
operator()(const _ValueTp& __v) const { }
};
/** @brief Compute the median of three referenced elements, /** @brief Compute the median of three referenced elements,
according to @c __comp. according to @c __comp.
* @param __a First iterator. * @param __a First iterator.
@ -408,7 +396,7 @@ namespace __gnu_parallel
template<typename _RAIter, typename _Compare> template<typename _RAIter, typename _Compare>
_RAIter _RAIter
__median_of_three_iterators(_RAIter __a, _RAIter __b, __median_of_three_iterators(_RAIter __a, _RAIter __b,
_RAIter __c, _Compare& __comp) _RAIter __c, _Compare __comp)
{ {
if (__comp(*__a, *__b)) if (__comp(*__a, *__b))
if (__comp(*__b, *__c)) if (__comp(*__b, *__c))