This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][libstdc++-v3 parallel mode] Tackle XXX todos: move compare to last place
- From: Johannes Singler <singler at ira dot uka dot de>
- To: libstdc++ <libstdc++ at gcc dot gnu dot org>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 23 Sep 2009 16:52:47 +0200
- Subject: [PATCH][libstdc++-v3 parallel mode] Tackle XXX todos: move compare to last place
This patch fixes a small todo, and removes another (cannot remove
duplicates of std:: functors because they have different structure).
Tested x86_64-unknown-linux-gnu: No regressions
Please approve for mainline.
2009-09-23 Johannes Singler <singler@ira.uka.de>
* include/parallel/algobase.h
(__lexicographical_compare_switch): Move compare template
parameter to the end as of others.
* include/parallel/base.h: Likewise; remove unsuitable comment.
I would also like to tackle other XXX todos, if the respective creators
could explain them to me:
include/parallel/checkers.h: // XXX Compare default template argument
include/parallel/for_each_selectors.h: // XXX move into type_traits?
include/parallel/partition.h: // XXX _Compare must have
first__ValueType, second__ValueType,
include/parallel/partition.h: // XXX binder2nd only for _RAIters??
The other ones are clear to me, but not so easy to fix.
Johannes
Index: include/parallel/base.h
===================================================================
--- include/parallel/base.h (revision 152061)
+++ include/parallel/base.h (working copy)
@@ -93,9 +93,6 @@
__is_parallel(const _Parallelism __p) { return __p != sequential; }
- // XXX remove std::duplicates from here if possible,
- // XXX but keep minimal dependencies.
-
/** @brief Calculates the rounded-down logarithm of @__c __n for base 2.
* @param __n Argument.
* @return Returns 0 for any argument <1.
@@ -154,8 +151,7 @@
/** @brief Constructs predicate for equality from strict weak
* ordering predicate
*/
-// XXX comparator at the end, as per others
-template<typename _Compare, typename _T1, typename _T2>
+template<typename _T1, typename _T2, typename _Compare>
class _EqualFromLess : public std::binary_function<_T1, _T2, bool>
{
private:
Index: include/parallel/algobase.h
===================================================================
--- include/parallel/algobase.h (revision 152061)
+++ include/parallel/algobase.h (working copy)
@@ -198,7 +198,7 @@
typedef typename _TraitsType2::value_type _ValueType2;
typedef __gnu_parallel::
- _EqualFromLess<_Predicate, _ValueType1, _ValueType2>
+ _EqualFromLess<_ValueType1, _ValueType2, _Predicate>
_EqualFromLessCompare;
// Longer sequence in first place.