From: Paolo Carlini Date: Tue, 13 Oct 2009 14:57:28 +0000 (+0000) Subject: for_each_selectors.h: Minor uglification and stylistic fixes. X-Git-Tag: releases/gcc-4.5.0~2935 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a018595e87017b5f77a791b20dadf45e7cb25e58;p=thirdparty%2Fgcc.git for_each_selectors.h: Minor uglification and stylistic fixes. 2009-10-13 Paolo Carlini * include/parallel/for_each_selectors.h: Minor uglification and stylistic fixes. From-SVN: r152708 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 9184ecd566c8..424967d35605 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,6 +1,12 @@ +2009-10-13 Paolo Carlini + + * include/parallel/for_each_selectors.h: Minor uglification and + stylistic fixes. + 2009-10-13 Edward Smith-Rowland <3dw4rd@verizon.net> - * include/precompiled/stdc++.h: Include for completeness. + * include/precompiled/stdc++.h: Include + for completeness. 2009-10-12 Paolo Carlini diff --git a/libstdc++-v3/include/parallel/for_each_selectors.h b/libstdc++-v3/include/parallel/for_each_selectors.h index 9fd432df0219..3a37e5ca6374 100644 --- a/libstdc++-v3/include/parallel/for_each_selectors.h +++ b/libstdc++-v3/include/parallel/for_each_selectors.h @@ -37,17 +37,15 @@ namespace __gnu_parallel { - /** @brief Generic __selector for embarrassingly parallel functions. */ template - struct __generic_for_each_selector - { - /** @brief _Iterator on last element processed; needed for some - * algorithms (e. g. std::transform()). - */ - _It _M_finish_iterator; - }; - + struct __generic_for_each_selector + { + /** @brief _Iterator on last element processed; needed for some + * algorithms (e. g. std::transform()). + */ + _It _M_finish_iterator; + }; /** @brief std::for_each() selector. */ template @@ -220,21 +218,21 @@ namespace __gnu_parallel }; /** @brief std::inner_product() selector. */ - template + template struct __inner_product_selector : public __generic_for_each_selector<_It> { /** @brief Begin iterator of first sequence. */ - _It __begin1_iterator; + _It __begin1_iterator; /** @brief Begin iterator of second sequence. */ - It2 begin2_iterator; + _It2 __begin2_iterator; /** @brief Constructor. * @param b1 Begin iterator of first sequence. * @param b2 Begin iterator of second sequence. */ explicit - __inner_product_selector(_It b1, It2 b2) - : __begin1_iterator(b1), begin2_iterator(b2) { } + __inner_product_selector(_It __b1, _It2 __b2) + : __begin1_iterator(__b1), __begin2_iterator(__b2) { } /** @brief Functor execution. * @param __mult Multiplication functor. @@ -246,7 +244,7 @@ namespace __gnu_parallel { typename std::iterator_traits<_It>::difference_type __position = __current - __begin1_iterator; - return __mult(*__current, *(begin2_iterator + __position)); + return __mult(*__current, *(__begin2_iterator + __position)); } }; @@ -268,8 +266,8 @@ namespace __gnu_parallel * __elements. */ template - struct __adjacent_difference_selector : - public __generic_for_each_selector<_It> + struct __adjacent_difference_selector + : public __generic_for_each_selector<_It> { template bool @@ -293,14 +291,14 @@ namespace __gnu_parallel * @param __i iterator referencing object. */ template void - operator()(_It __i) { } + operator()(_It) { } }; /** @brief Reduction function doing nothing. */ struct _DummyReduct { bool - operator()(bool /*__x*/, bool /*__y*/) const + operator()(bool, bool) const { return true; } }; @@ -315,12 +313,7 @@ namespace __gnu_parallel _It operator()(_It __x, _It __y) - { - if (__comp(*__x, *__y)) - return __x; - else - return __y; - } + { return (__comp(*__x, *__y)) ? __x : __y; } }; /** @brief Reduction for finding the maximum element, using a comparator. */ @@ -334,12 +327,7 @@ namespace __gnu_parallel _It operator()(_It __x, _It __y) - { - if (__comp(*__x, *__y)) - return __y; - else - return __x; - } + { return (__comp(*__x, *__y)) ? __y : __x; } }; /** @brief General reduction, using a binary operator. */