diff options
author | Johannes Singler <singler@ira.uka.de> | 2009-09-25 08:39:09 +0000 |
---|---|---|
committer | Johannes Singler <singler@gcc.gnu.org> | 2009-09-25 08:39:09 +0000 |
commit | 0e505d53d5819b2820651261fb3999236d648423 (patch) | |
tree | 2d102eb4242393fc3fe37e55cdfcdc4fb2027b83 | |
parent | 3b06118a0a942f43a31be199e564572e9e362dd3 (diff) | |
download | gcc-0e505d53d5819b2820651261fb3999236d648423.zip gcc-0e505d53d5819b2820651261fb3999236d648423.tar.gz gcc-0e505d53d5819b2820651261fb3999236d648423.tar.bz2 |
2009-09-25 Johannes Singler <singler@ira.uka.de>
* include/parallel/include/parallel/checkers.h
(is_sorted_failure, is_sorted_print_failures): Remove (unused).
(__is_sorted): Remove default parameter for _Compare; remove
inappropriate printf.
From-SVN: r152162
-rw-r--r-- | libstdc++-v3/ChangeLog | 7 | ||||
-rw-r--r-- | libstdc++-v3/include/parallel/checkers.h | 87 |
2 files changed, 8 insertions, 86 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index cf5d185..83edeb7 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,12 @@ 2009-09-25 Johannes Singler <singler@ira.uka.de> + * include/parallel/include/parallel/checkers.h + (is_sorted_failure, is_sorted_print_failures): Remove (unused). + (__is_sorted): Remove default parameter for _Compare; remove + inappropriate printf. + +2009-09-25 Johannes Singler <singler@ira.uka.de> + * include/parallel/base.h: Comment on presence of min/max duplicates. 2009-09-25 Johannes Singler <singler@ira.uka.de> diff --git a/libstdc++-v3/include/parallel/checkers.h b/libstdc++-v3/include/parallel/checkers.h index 5d3acfa..70cc949 100644 --- a/libstdc++-v3/include/parallel/checkers.h +++ b/libstdc++-v3/include/parallel/checkers.h @@ -46,13 +46,9 @@ namespace __gnu_parallel * @param __comp Comparator. * @return @__c true if sorted, @__c false otherwise. */ - // XXX Compare default template argument template<typename _IIter, typename _Compare> bool - __is_sorted(_IIter __begin, _IIter __end, - _Compare __comp - = std::less<typename std::iterator_traits<_IIter>:: - _ValueType>()) + __is_sorted(_IIter __begin, _IIter __end, _Compare __comp) { if (__begin == __end) return true; @@ -64,8 +60,6 @@ namespace __gnu_parallel { if (__comp(*__current, *__recent)) { - printf("__is_sorted: check failed before position %__i.\n", - __position); return false; } __recent = __current; @@ -75,83 +69,4 @@ namespace __gnu_parallel return true; } - /** - * @brief Check whether @__c [__begin, @__c __end) is sorted according to - * @__c __comp. - * Prints the position in case an unordered pair is found. - * @param __begin Begin iterator of sequence. - * @param __end End iterator of sequence. - * @param __first_failure The first failure is returned in this variable. - * @param __comp Comparator. - * @return @__c true if sorted, @__c false otherwise. - */ - // XXX Compare default template argument - template<typename _IIter, typename _Compare> - bool - is_sorted_failure(_IIter __begin, _IIter __end, - _IIter& __first_failure, - _Compare __comp - = std::less<typename std::iterator_traits<_IIter>:: - _ValueType>()) - { - if (__begin == __end) - return true; - - _IIter __current(__begin), __recent(__begin); - - unsigned long long __position = 1; - for (__current++; __current != __end; __current++) - { - if (__comp(*__current, *__recent)) - { - __first_failure = __current; - printf("__is_sorted: check failed before position %lld.\n", - __position); - return false; - } - __recent = __current; - __position++; - } - - __first_failure = __end; - return true; - } - - /** - * @brief Check whether @__c [__begin, @__c __end) is sorted according to - * @__c __comp. - * Prints all unordered pair, including the surrounding two elements. - * @param __begin Begin iterator of sequence. - * @param __end End iterator of sequence. - * @param __comp Comparator. - * @return @__c true if sorted, @__c false otherwise. - */ - template<typename _IIter, typename _Compare> - bool - // XXX Compare default template argument - is_sorted_print_failures(_IIter __begin, _IIter __end, - _Compare __comp - = std::less<typename std::iterator_traits - <_IIter>::value_type>()) - { - if (__begin == __end) - return true; - - _IIter __recent(__begin); - bool __ok = true; - - for (_IIter __pos(__begin + 1); __pos != __end; __pos++) - { - if (__comp(*__pos, *__recent)) - { - printf("%ld: %d %d %d %d\n", __pos - __begin, *(__pos - 2), - *(__pos- 1), *__pos, *(__pos + 1)); - __ok = false; - } - __recent = __pos; - } - return __ok; - } -} - #endif /* _GLIBCXX_PARALLEL_CHECKERS_H */ |