From 2cb55b6b6c13c956bf64cb69ded45d6ff1d0a72d Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Thu, 21 Mar 2013 20:00:42 +0900 Subject: [PATCH] fix for GCC4.8 RC --- sprout/algorithm/adjacent_find.hpp | 1 - sprout/algorithm/all_of.hpp | 1 - sprout/algorithm/all_of_equal.hpp | 1 - sprout/algorithm/any_of.hpp | 1 - sprout/algorithm/any_of_equal.hpp | 1 - sprout/algorithm/count.hpp | 1 - sprout/algorithm/count_if.hpp | 1 - sprout/algorithm/equal.hpp | 1 - sprout/algorithm/find.hpp | 1 - sprout/algorithm/find_difference.hpp | 1 - sprout/algorithm/find_end.hpp | 2 - sprout/algorithm/find_first_of.hpp | 1 - sprout/algorithm/find_if.hpp | 1 - sprout/algorithm/find_if_not.hpp | 1 - sprout/algorithm/find_intersection.hpp | 1 - .../algorithm/find_symmetric_difference.hpp | 1 - sprout/algorithm/fixed/bogo_sort_result.hpp | 1 - sprout/algorithm/fixed/bozo_sort_result.hpp | 1 - sprout/algorithm/includes.hpp | 1 - sprout/algorithm/is_partitioned.hpp | 1 - sprout/algorithm/is_permutation.hpp | 1 - sprout/algorithm/is_sorted_until.hpp | 1 - sprout/algorithm/lexicographical_compare.hpp | 1 - sprout/algorithm/max_element.hpp | 1 - sprout/algorithm/min_element.hpp | 1 - sprout/algorithm/minmax_element.hpp | 1 - sprout/algorithm/mismatch.hpp | 1 - sprout/algorithm/none_of.hpp | 1 - sprout/algorithm/none_of_equal.hpp | 1 - sprout/algorithm/one_of.hpp | 1 - sprout/algorithm/one_of_equal.hpp | 1 - sprout/algorithm/search.hpp | 2 - .../tristate_lexicographical_compare.hpp | 2 - sprout/assert.hpp | 1 - sprout/bitset/bitset.hpp | 80 ++++++++++--------- sprout/compost/utility/iir_filter.hpp | 1 - sprout/container/deep_internal.hpp | 7 +- sprout/cstring/strchr.hpp | 1 - sprout/cstring/strcmp.hpp | 1 - sprout/cstring/strcspn.hpp | 1 - sprout/cstring/strlen.hpp | 1 - sprout/cstring/strpbrk.hpp | 1 - sprout/cstring/strrchr.hpp | 1 - sprout/cstring/strspn.hpp | 1 - sprout/cstring/strstr.hpp | 2 - sprout/detail/algorithm/overlap_count.hpp | 1 - sprout/detail/algorithm/set_overlap_count.hpp | 1 - sprout/iterator/distance.hpp | 1 - sprout/numeric/accumulate.hpp | 1 - sprout/numeric/dft/fixed/sawtooth.hpp | 1 - sprout/numeric/dft/fixed/square.hpp | 1 - sprout/numeric/dft/fixed/triangle.hpp | 1 - sprout/numeric/inner_product.hpp | 1 - sprout/random/uniform_real_distribution.hpp | 1 - testspr/iterator.hpp | 4 +- 55 files changed, 48 insertions(+), 99 deletions(-) diff --git a/sprout/algorithm/adjacent_find.hpp b/sprout/algorithm/adjacent_find.hpp index 4cfb4f3e..e227e0c5 100644 --- a/sprout/algorithm/adjacent_find.hpp +++ b/sprout/algorithm/adjacent_find.hpp @@ -94,7 +94,6 @@ namespace sprout { ForwardIterator last, BinaryPredicate pred, typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return current.second == last ? current : sprout::detail::adjacent_find_impl( sprout::detail::adjacent_find_impl_1( diff --git a/sprout/algorithm/all_of.hpp b/sprout/algorithm/all_of.hpp index 44b91d6f..94e66a0c 100644 --- a/sprout/algorithm/all_of.hpp +++ b/sprout/algorithm/all_of.hpp @@ -69,7 +69,6 @@ namespace sprout { InputIterator last, Predicate pred, typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return !current.second || current.first == last ? current : sprout::detail::all_of_impl( sprout::detail::all_of_impl_1( diff --git a/sprout/algorithm/all_of_equal.hpp b/sprout/algorithm/all_of_equal.hpp index c431beb5..76aca3b7 100644 --- a/sprout/algorithm/all_of_equal.hpp +++ b/sprout/algorithm/all_of_equal.hpp @@ -69,7 +69,6 @@ namespace sprout { InputIterator last, T const& value, typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return !current.second || current.first == last ? current : sprout::detail::all_of_equal_impl( sprout::detail::all_of_equal_impl_1( diff --git a/sprout/algorithm/any_of.hpp b/sprout/algorithm/any_of.hpp index b30db898..dc52e1f6 100644 --- a/sprout/algorithm/any_of.hpp +++ b/sprout/algorithm/any_of.hpp @@ -69,7 +69,6 @@ namespace sprout { InputIterator last, Predicate pred, typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return current.second || current.first == last ? current : sprout::detail::any_of_impl( sprout::detail::any_of_impl_1( diff --git a/sprout/algorithm/any_of_equal.hpp b/sprout/algorithm/any_of_equal.hpp index d1382b51..88f813ba 100644 --- a/sprout/algorithm/any_of_equal.hpp +++ b/sprout/algorithm/any_of_equal.hpp @@ -69,7 +69,6 @@ namespace sprout { InputIterator last, T const& value, typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return current.second || current.first == last ? current : sprout::detail::any_of_equal_impl( sprout::detail::any_of_equal_impl_1( diff --git a/sprout/algorithm/count.hpp b/sprout/algorithm/count.hpp index 311f9282..bb915c33 100644 --- a/sprout/algorithm/count.hpp +++ b/sprout/algorithm/count.hpp @@ -69,7 +69,6 @@ namespace sprout { InputIterator last, T const& value, typename std::iterator_traits::difference_type n ) { - typedef sprout::pair::difference_type> type; return current.first == last ? current : sprout::detail::count_impl( sprout::detail::count_impl_1( diff --git a/sprout/algorithm/count_if.hpp b/sprout/algorithm/count_if.hpp index c2efa57b..60b52cb4 100644 --- a/sprout/algorithm/count_if.hpp +++ b/sprout/algorithm/count_if.hpp @@ -69,7 +69,6 @@ namespace sprout { InputIterator last, Predicate pred, typename std::iterator_traits::difference_type n ) { - typedef sprout::pair::difference_type> type; return current.first == last ? current : sprout::detail::count_if_impl( sprout::detail::count_if_impl_1( diff --git a/sprout/algorithm/equal.hpp b/sprout/algorithm/equal.hpp index b5ef4f0f..1999f654 100644 --- a/sprout/algorithm/equal.hpp +++ b/sprout/algorithm/equal.hpp @@ -76,7 +76,6 @@ namespace sprout { InputIterator1 last1, BinaryPredicate pred, typename std::iterator_traits::difference_type n ) { - typedef sprout::tuples::tuple type; return !sprout::tuples::get<2>(current) || sprout::tuples::get<0>(current) == last1 ? current : sprout::detail::equal_impl( sprout::detail::equal_impl_1( diff --git a/sprout/algorithm/find.hpp b/sprout/algorithm/find.hpp index 687c2b4d..89a3202c 100644 --- a/sprout/algorithm/find.hpp +++ b/sprout/algorithm/find.hpp @@ -71,7 +71,6 @@ namespace sprout { InputIterator last, T const& value, typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return current.second || current.first == last ? current : sprout::detail::find_impl( sprout::detail::find_impl_1( diff --git a/sprout/algorithm/find_difference.hpp b/sprout/algorithm/find_difference.hpp index ceb3ce7b..0aa62057 100644 --- a/sprout/algorithm/find_difference.hpp +++ b/sprout/algorithm/find_difference.hpp @@ -59,7 +59,6 @@ namespace sprout { InputIterator1 last1, InputIterator2 last2, Compare comp, typename std::iterator_traits::difference_type n ) { - typedef sprout::tuples::tuple type; return sprout::tuples::get<2>(current) || sprout::tuples::get<0>(current) == last1 ? current : sprout::detail::find_difference_impl( sprout::detail::find_difference_impl_1( diff --git a/sprout/algorithm/find_end.hpp b/sprout/algorithm/find_end.hpp index be7ab0aa..3ec9b72b 100644 --- a/sprout/algorithm/find_end.hpp +++ b/sprout/algorithm/find_end.hpp @@ -94,7 +94,6 @@ namespace sprout { typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return current.first == last1 ? current : n == 1 ? sprout::detail::find_end_impl_check( current, last1, @@ -117,7 +116,6 @@ namespace sprout { typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return current.first == last1 ? current : sprout::detail::find_end_impl( sprout::detail::find_end_impl_1( diff --git a/sprout/algorithm/find_first_of.hpp b/sprout/algorithm/find_first_of.hpp index 53027fe2..62eac1d5 100644 --- a/sprout/algorithm/find_first_of.hpp +++ b/sprout/algorithm/find_first_of.hpp @@ -85,7 +85,6 @@ namespace sprout { typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return current.second || current.first == last1 ? current : sprout::detail::find_first_of_impl( sprout::detail::find_first_of_impl_1( diff --git a/sprout/algorithm/find_if.hpp b/sprout/algorithm/find_if.hpp index 4ce01c3a..a0d3210b 100644 --- a/sprout/algorithm/find_if.hpp +++ b/sprout/algorithm/find_if.hpp @@ -71,7 +71,6 @@ namespace sprout { InputIterator last, Predicate pred, typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return current.second || current.first == last ? current : sprout::detail::find_if_impl( sprout::detail::find_if_impl_1( diff --git a/sprout/algorithm/find_if_not.hpp b/sprout/algorithm/find_if_not.hpp index 9541b7c8..1e5c7d97 100644 --- a/sprout/algorithm/find_if_not.hpp +++ b/sprout/algorithm/find_if_not.hpp @@ -71,7 +71,6 @@ namespace sprout { InputIterator last, Predicate pred, typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return current.second || current.first == last ? current : sprout::detail::find_if_not_impl( sprout::detail::find_if_not_impl_1( diff --git a/sprout/algorithm/find_intersection.hpp b/sprout/algorithm/find_intersection.hpp index a1dfa539..b580c25f 100644 --- a/sprout/algorithm/find_intersection.hpp +++ b/sprout/algorithm/find_intersection.hpp @@ -57,7 +57,6 @@ namespace sprout { InputIterator1 last1, InputIterator2 last2, Compare comp, typename std::iterator_traits::difference_type n ) { - typedef sprout::tuples::tuple type; return sprout::tuples::get<2>(current) || sprout::tuples::get<0>(current) == last1 || sprout::tuples::get<1>(current) == last2 ? current : sprout::detail::find_intersection_impl( sprout::detail::find_intersection_impl_1( diff --git a/sprout/algorithm/find_symmetric_difference.hpp b/sprout/algorithm/find_symmetric_difference.hpp index cec241d0..40b4b989 100644 --- a/sprout/algorithm/find_symmetric_difference.hpp +++ b/sprout/algorithm/find_symmetric_difference.hpp @@ -48,7 +48,6 @@ namespace sprout { InputIterator1 last1, InputIterator2 last2, Compare comp, typename std::iterator_traits::difference_type n ) { - typedef sprout::tuples::tuple type; return sprout::tuples::get<2>(current) || sprout::tuples::get<0>(current) == last1 ? current : sprout::detail::find_symmetric_difference_impl( sprout::detail::find_symmetric_difference_impl_1( diff --git a/sprout/algorithm/fixed/bogo_sort_result.hpp b/sprout/algorithm/fixed/bogo_sort_result.hpp index 1699dccf..d8cfaf65 100644 --- a/sprout/algorithm/fixed/bogo_sort_result.hpp +++ b/sprout/algorithm/fixed/bogo_sort_result.hpp @@ -45,7 +45,6 @@ namespace sprout { Compare comp, Difference n ) { - typedef sprout::pair type; return current.second ? current : sprout::fixed::detail::bogo_sort_result_impl( sprout::fixed::detail::bogo_sort_result_impl_1( diff --git a/sprout/algorithm/fixed/bozo_sort_result.hpp b/sprout/algorithm/fixed/bozo_sort_result.hpp index 13eeaa2f..938cc093 100644 --- a/sprout/algorithm/fixed/bozo_sort_result.hpp +++ b/sprout/algorithm/fixed/bozo_sort_result.hpp @@ -45,7 +45,6 @@ namespace sprout { Compare comp, Difference n ) { - typedef sprout::pair type; return current.second ? current : sprout::fixed::detail::bozo_sort_result_impl( sprout::fixed::detail::bozo_sort_result_impl_1( diff --git a/sprout/algorithm/includes.hpp b/sprout/algorithm/includes.hpp index c971c70a..25b40e7c 100644 --- a/sprout/algorithm/includes.hpp +++ b/sprout/algorithm/includes.hpp @@ -82,7 +82,6 @@ namespace sprout { typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return current.second == last2 || current.first == last1 ? current : sprout::detail::includes_impl( sprout::detail::includes_impl_1( diff --git a/sprout/algorithm/is_partitioned.hpp b/sprout/algorithm/is_partitioned.hpp index ff6e1498..68496a09 100644 --- a/sprout/algorithm/is_partitioned.hpp +++ b/sprout/algorithm/is_partitioned.hpp @@ -63,7 +63,6 @@ namespace sprout { InputIterator last, Predicate pred, typename std::iterator_traits::difference_type n ) { - typedef sprout::pair::difference_type> type; return current.second > 1 || current.first == last ? current : sprout::detail::is_partitioned_impl( sprout::detail::is_partitioned_impl_1( diff --git a/sprout/algorithm/is_permutation.hpp b/sprout/algorithm/is_permutation.hpp index 8961e37d..b3e8df77 100644 --- a/sprout/algorithm/is_permutation.hpp +++ b/sprout/algorithm/is_permutation.hpp @@ -84,7 +84,6 @@ namespace sprout { BinaryPredicate pred, typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return !current.second || current.first == last1 ? current : sprout::detail::is_permutation_impl( sprout::detail::is_permutation_impl_1( diff --git a/sprout/algorithm/is_sorted_until.hpp b/sprout/algorithm/is_sorted_until.hpp index 5582ae5e..639a2885 100644 --- a/sprout/algorithm/is_sorted_until.hpp +++ b/sprout/algorithm/is_sorted_until.hpp @@ -79,7 +79,6 @@ namespace sprout { ForwardIterator last, Compare comp, typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return current.second == last ? current : sprout::detail::is_sorted_until_impl( sprout::detail::is_sorted_until_impl_1( diff --git a/sprout/algorithm/lexicographical_compare.hpp b/sprout/algorithm/lexicographical_compare.hpp index 08fc9d06..37eeb11b 100644 --- a/sprout/algorithm/lexicographical_compare.hpp +++ b/sprout/algorithm/lexicographical_compare.hpp @@ -111,7 +111,6 @@ namespace sprout { typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return current.second == last2 || current.first == last1 ? current : sprout::detail::lexicographical_compare_impl( sprout::detail::lexicographical_compare_impl_1( diff --git a/sprout/algorithm/max_element.hpp b/sprout/algorithm/max_element.hpp index b7f59097..5b8d560d 100644 --- a/sprout/algorithm/max_element.hpp +++ b/sprout/algorithm/max_element.hpp @@ -82,7 +82,6 @@ namespace sprout { ForwardIterator last, Compare comp, typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return current.first == last ? current : sprout::detail::max_element_impl( sprout::detail::max_element_impl_1( diff --git a/sprout/algorithm/min_element.hpp b/sprout/algorithm/min_element.hpp index 5c3ecda7..3c5c58d4 100644 --- a/sprout/algorithm/min_element.hpp +++ b/sprout/algorithm/min_element.hpp @@ -82,7 +82,6 @@ namespace sprout { ForwardIterator last, Compare comp, typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return current.first == last ? current : sprout::detail::min_element_impl( sprout::detail::min_element_impl_1( diff --git a/sprout/algorithm/minmax_element.hpp b/sprout/algorithm/minmax_element.hpp index d3d1d49c..776f06e8 100644 --- a/sprout/algorithm/minmax_element.hpp +++ b/sprout/algorithm/minmax_element.hpp @@ -94,7 +94,6 @@ namespace sprout { ForwardIterator last, Compare comp, typename std::iterator_traits::difference_type n ) { - typedef sprout::pair > type; return current.first == last ? current : sprout::detail::minmax_element_impl( sprout::detail::minmax_element_impl_1( diff --git a/sprout/algorithm/mismatch.hpp b/sprout/algorithm/mismatch.hpp index 0463a502..f510acd6 100644 --- a/sprout/algorithm/mismatch.hpp +++ b/sprout/algorithm/mismatch.hpp @@ -97,7 +97,6 @@ namespace sprout { InputIterator1 last1, BinaryPredicate pred, typename std::iterator_traits::difference_type n ) { - typedef sprout::tuples::tuple type; return sprout::tuples::get<2>(current) || sprout::tuples::get<0>(current) == last1 ? current : sprout::detail::mismatch_impl( sprout::detail::mismatch_impl_1( diff --git a/sprout/algorithm/none_of.hpp b/sprout/algorithm/none_of.hpp index 33a8fd95..9888be05 100644 --- a/sprout/algorithm/none_of.hpp +++ b/sprout/algorithm/none_of.hpp @@ -69,7 +69,6 @@ namespace sprout { InputIterator last, Predicate pred, typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return !current.second || current.first == last ? current : sprout::detail::none_of_impl( sprout::detail::none_of_impl_1( diff --git a/sprout/algorithm/none_of_equal.hpp b/sprout/algorithm/none_of_equal.hpp index 7cf7f511..e06635dd 100644 --- a/sprout/algorithm/none_of_equal.hpp +++ b/sprout/algorithm/none_of_equal.hpp @@ -69,7 +69,6 @@ namespace sprout { InputIterator last, T const& value, typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return !current.second || current.first == last ? current : sprout::detail::none_of_equal_impl( sprout::detail::none_of_equal_impl_1( diff --git a/sprout/algorithm/one_of.hpp b/sprout/algorithm/one_of.hpp index 8f96e7bc..3a6be218 100644 --- a/sprout/algorithm/one_of.hpp +++ b/sprout/algorithm/one_of.hpp @@ -93,7 +93,6 @@ namespace sprout { InputIterator last, Predicate pred, typename std::iterator_traits::difference_type n ) { - typedef sprout::pair::difference_type> type; return current.second > 1 || current.first == last ? current : sprout::detail::one_of_impl( sprout::detail::one_of_impl_1( diff --git a/sprout/algorithm/one_of_equal.hpp b/sprout/algorithm/one_of_equal.hpp index 2fad7b0c..2505fd46 100644 --- a/sprout/algorithm/one_of_equal.hpp +++ b/sprout/algorithm/one_of_equal.hpp @@ -93,7 +93,6 @@ namespace sprout { InputIterator last, T const& value, typename std::iterator_traits::difference_type n ) { - typedef sprout::pair::difference_type> type; return current.second > 1 || current.first == last ? current : sprout::detail::one_of_equal_impl( sprout::detail::one_of_equal_impl_1( diff --git a/sprout/algorithm/search.hpp b/sprout/algorithm/search.hpp index 143225cd..887d38da 100644 --- a/sprout/algorithm/search.hpp +++ b/sprout/algorithm/search.hpp @@ -70,7 +70,6 @@ namespace sprout { typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return current.second || current.first == last1 ? current : n == 1 ? sprout::detail::search_impl_fork( current, last1, @@ -93,7 +92,6 @@ namespace sprout { typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return current.second || current.first == last1 ? current : sprout::detail::search_impl( sprout::detail::search_impl_1( diff --git a/sprout/algorithm/tristate_lexicographical_compare.hpp b/sprout/algorithm/tristate_lexicographical_compare.hpp index 548cbbc0..1b4f5cc1 100644 --- a/sprout/algorithm/tristate_lexicographical_compare.hpp +++ b/sprout/algorithm/tristate_lexicographical_compare.hpp @@ -114,7 +114,6 @@ namespace sprout { typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return current.second == last2 || current.first == last1 ? current : sprout::detail::tristate_lexicographical_compare_impl( sprout::detail::tristate_lexicographical_compare_impl_1( @@ -281,7 +280,6 @@ namespace sprout { typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return current.second == last2 || current.first == last1 ? current : sprout::detail::tristate_lexicographical_compare_impl( sprout::detail::tristate_lexicographical_compare_impl_1( diff --git a/sprout/assert.hpp b/sprout/assert.hpp index 222aac47..af5c1855 100644 --- a/sprout/assert.hpp +++ b/sprout/assert.hpp @@ -5,7 +5,6 @@ # include #elif defined(SPROUT_ENABLE_ASSERT_HANDLER) # include -# include #else # include # include diff --git a/sprout/bitset/bitset.hpp b/sprout/bitset/bitset.hpp index 1d166150..44f04837 100644 --- a/sprout/bitset/bitset.hpp +++ b/sprout/bitset/bitset.hpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -26,6 +27,11 @@ namespace sprout { namespace detail { + template + struct size_t_ + : public std::integral_constant + {}; + struct base_bitset_from_words_construct_tag {}; template @@ -72,15 +78,15 @@ namespace sprout { public: static SPROUT_CONSTEXPR std::size_t whichword(std::size_t pos) SPROUT_NOEXCEPT { - return pos / (CHAR_BIT * sizeof(unsigned long)); + return pos / (CHAR_BIT * sprout::detail::size_t_::value); } static SPROUT_CONSTEXPR std::size_t whichbyte(std::size_t pos) SPROUT_NOEXCEPT { - return (pos % (CHAR_BIT * sizeof(unsigned long))) / CHAR_BIT; + return (pos % (CHAR_BIT * sprout::detail::size_t_::value)) / CHAR_BIT; } static SPROUT_CONSTEXPR std::size_t whichbit(std::size_t pos) SPROUT_NOEXCEPT { - return pos % (CHAR_BIT * sizeof(unsigned long)); + return pos % (CHAR_BIT * sprout::detail::size_t_::value); } static SPROUT_CONSTEXPR word_type maskbit(std::size_t pos) SPROUT_NOEXCEPT { @@ -97,7 +103,7 @@ namespace sprout { { return first == last ? not_found : *first != static_cast(0) - ? i * (CHAR_BIT * sizeof(unsigned long)) + sprout::ctz(*first) + ? i * (CHAR_BIT * sprout::detail::size_t_::value) + sprout::ctz(*first) : find_first_impl(not_found, first + 1, last, i + 1) ; } @@ -109,14 +115,14 @@ namespace sprout { { return first == last ? not_found : *first != static_cast(0) - ? i * (CHAR_BIT * sizeof(unsigned long)) + sprout::ctz(*first) + ? i * (CHAR_BIT * sprout::detail::size_t_::value) + sprout::ctz(*first) : find_next_impl_2(not_found, first + 1, last) ; } SPROUT_CONSTEXPR std::size_t find_next_impl_1(std::size_t not_found, std::size_t i, word_type thisword) const SPROUT_NOEXCEPT { return thisword != static_cast(0) - ? i * (CHAR_BIT * sizeof(unsigned long)) + sprout::ctz(thisword) + ? i * (CHAR_BIT * sprout::detail::size_t_::value) + sprout::ctz(thisword) : find_next_impl_2(not_found, begin() + (i + 1), end(), i + 1) ; } @@ -162,7 +168,7 @@ namespace sprout { sprout::index_range<0, N>::make() ) : do_left_shift_impl_2( - wshift, offset, (CHAR_BIT * sizeof(unsigned long)) - offset, + wshift, offset, (CHAR_BIT * sprout::detail::size_t_::value) - offset, sprout::index_range<0, N>::make() ) ; @@ -206,7 +212,7 @@ namespace sprout { sprout::index_range<0, N>::make() ) : do_right_shift_impl_2( - wshift, offset, limit, (CHAR_BIT * sizeof(unsigned long)) - offset, + wshift, offset, limit, (CHAR_BIT * sprout::detail::size_t_::value) - offset, sprout::index_range<0, N>::make() ) ; @@ -216,7 +222,7 @@ namespace sprout { : w_() {} SPROUT_CONSTEXPR base_bitset(unsigned long long val) SPROUT_NOEXCEPT - : w_{word_type(val), word_type(val >> (CHAR_BIT * sizeof(unsigned long)))} + : w_{word_type(val), word_type(val >> (CHAR_BIT * sprout::detail::size_t_::value))} {} template SPROUT_CONSTEXPR base_bitset(sprout::detail::base_bitset_from_words_construct_tag, Words... words) @@ -296,14 +302,14 @@ namespace sprout { void do_left_shift(std::size_t shift) SPROUT_NOEXCEPT { if (shift != 0) { - std::size_t const wshift = shift / (CHAR_BIT * sizeof(unsigned long)); - std::size_t const offset = shift % (CHAR_BIT * sizeof(unsigned long)); + std::size_t const wshift = shift / (CHAR_BIT * sprout::detail::size_t_::value); + std::size_t const offset = shift % (CHAR_BIT * sprout::detail::size_t_::value); if (offset == 0) { for (std::size_t n = N - 1; n >= wshift; --n) { w_[n] = w_[n - wshift]; } } else { - std::size_t const sub_offset = (CHAR_BIT * sizeof(unsigned long)) - offset; + std::size_t const sub_offset = (CHAR_BIT * sprout::detail::size_t_::value) - offset; for (std::size_t n = N - 1; n > wshift; --n) { w_[n] = (w_[n - wshift] << offset) | (w_[n - wshift - 1] >> sub_offset); } @@ -315,8 +321,8 @@ namespace sprout { SPROUT_CONSTEXPR base_bitset do_left_shift(std::size_t shift) const SPROUT_NOEXCEPT { return shift != 0 ? do_left_shift_impl( - shift / (CHAR_BIT * sizeof(unsigned long)), - shift % (CHAR_BIT * sizeof(unsigned long)) + shift / (CHAR_BIT * sprout::detail::size_t_::value), + shift % (CHAR_BIT * sprout::detail::size_t_::value) ) : *this ; @@ -324,15 +330,15 @@ namespace sprout { void do_right_shift(std::size_t shift) SPROUT_NOEXCEPT { if (shift != 0) { - std::size_t const wshift = shift / (CHAR_BIT * sizeof(unsigned long)); - std::size_t const offset = shift % (CHAR_BIT * sizeof(unsigned long)); + std::size_t const wshift = shift / (CHAR_BIT * sprout::detail::size_t_::value); + std::size_t const offset = shift % (CHAR_BIT * sprout::detail::size_t_::value); std::size_t const limit = N - wshift - 1; if (offset == 0) { for (std::size_t n = 0; n <= limit; ++n) { w_[n] = w_[n + wshift]; } } else { - std::size_t const sub_offset = (CHAR_BIT * sizeof(unsigned long)) - offset; + std::size_t const sub_offset = (CHAR_BIT * sprout::detail::size_t_::value) - offset; for (std::size_t n = 0; n < limit; ++n) { w_[n] = (w_[n + wshift] >> offset) | (w_[n + wshift + 1] << sub_offset); } @@ -344,9 +350,9 @@ namespace sprout { SPROUT_CONSTEXPR base_bitset do_right_shift(std::size_t shift) const SPROUT_NOEXCEPT { return shift != 0 ? do_right_shift_impl( - shift / (CHAR_BIT * sizeof(unsigned long)), - shift % (CHAR_BIT * sizeof(unsigned long)), - N - shift / (CHAR_BIT * sizeof(unsigned long)) - 1 + shift / (CHAR_BIT * sprout::detail::size_t_::value), + shift % (CHAR_BIT * sprout::detail::size_t_::value), + N - shift / (CHAR_BIT * sprout::detail::size_t_::value) - 1 ) : *this ; @@ -379,7 +385,7 @@ namespace sprout { } void do_reset() SPROUT_NOEXCEPT { - std::memset(w_, 0, N * sizeof(word_type)); + std::memset(w_, 0, N * sprout::detail::size_t_::value); } SPROUT_CONSTEXPR bool @@ -390,7 +396,7 @@ namespace sprout { SPROUT_CONSTEXPR bool are_all() const SPROUT_NOEXCEPT { return sprout::all_of(begin(), end() - 1, are_all_pred()) - && hiword() == (~static_cast(0) >> (N * (CHAR_BIT * sizeof(unsigned long)) - N2)) + && hiword() == (~static_cast(0) >> (N * (CHAR_BIT * sprout::detail::size_t_::value) - N2)) ; } SPROUT_CONSTEXPR bool @@ -412,14 +418,14 @@ namespace sprout { SPROUT_CONSTEXPR unsigned long long do_to_ullong() const { return sprout::find_if( - sizeof(unsigned long long) > sizeof(unsigned long) ? begin() + 2 + sprout::detail::size_t_::value > sprout::detail::size_t_::value ? begin() + 2 : begin() + 1 , end(), to_ulong_pred() ) != end() ? throw std::overflow_error("base_bitset::to_ullong") - : sizeof(unsigned long long) > sizeof(unsigned long) + : sprout::detail::size_t_::value > sprout::detail::size_t_::value ? w_[0] + (static_cast(w_[1]) << (CHAR_BIT * sizeof(unsigned long))) : w_[0] ; @@ -431,7 +437,7 @@ namespace sprout { } SPROUT_CONSTEXPR std::size_t find_next(std::size_t prev, std::size_t not_found) const SPROUT_NOEXCEPT { - return prev + 1 >= N * (CHAR_BIT * sizeof(unsigned long)) ? not_found + return prev + 1 >= N * (CHAR_BIT * sprout::detail::size_t_::value) ? not_found : find_next_impl(prev + 1, not_found, whichword(prev + 1)); ; } @@ -469,15 +475,15 @@ namespace sprout { public: static SPROUT_CONSTEXPR std::size_t whichword(std::size_t pos) SPROUT_NOEXCEPT { - return pos / (CHAR_BIT * sizeof(unsigned long)); + return pos / (CHAR_BIT * sprout::detail::size_t_::value); } static SPROUT_CONSTEXPR std::size_t whichbyte(std::size_t pos) SPROUT_NOEXCEPT { - return (pos % (CHAR_BIT * sizeof(unsigned long))) / CHAR_BIT; + return (pos % (CHAR_BIT * sprout::detail::size_t_::value)) / CHAR_BIT; } static SPROUT_CONSTEXPR std::size_t whichbit(std::size_t pos) SPROUT_NOEXCEPT { - return pos % (CHAR_BIT * sizeof(unsigned long)); + return pos % (CHAR_BIT * sprout::detail::size_t_::value); } static SPROUT_CONSTEXPR word_type maskbit(std::size_t pos) SPROUT_NOEXCEPT { @@ -635,7 +641,7 @@ namespace sprout { } SPROUT_CONSTEXPR std::size_t find_next(std::size_t prev, std::size_t not_found) const SPROUT_NOEXCEPT { - return prev + 1 >= static_cast(CHAR_BIT * sizeof(unsigned long)) ? not_found + return prev + 1 >= static_cast(CHAR_BIT * sprout::detail::size_t_::value) ? not_found : find_next_impl(prev + 1, not_found, w_ >> (prev + 1)) ; } @@ -652,17 +658,17 @@ namespace sprout { public: static SPROUT_CONSTEXPR std::size_t whichword(std::size_t pos) SPROUT_NOEXCEPT { - return pos / (CHAR_BIT * sizeof(unsigned long)); + return pos / (CHAR_BIT * sprout::detail::size_t_::value); } static SPROUT_CONSTEXPR std::size_t whichbyte(std::size_t pos) SPROUT_NOEXCEPT { - return (pos % (CHAR_BIT * sizeof(unsigned long))) / CHAR_BIT; + return (pos % (CHAR_BIT * sprout::detail::size_t_::value)) / CHAR_BIT; } static SPROUT_CONSTEXPR std::size_t whichbit(std::size_t pos) SPROUT_NOEXCEPT { - return pos % (CHAR_BIT * sizeof(unsigned long)); + return pos % (CHAR_BIT * sprout::detail::size_t_::value); } static SPROUT_CONSTEXPR word_type @@ -815,7 +821,7 @@ namespace sprout { } }; - template + template::value))> struct sanitize_val { public: static SPROUT_CONSTEXPR unsigned long long @@ -886,12 +892,12 @@ namespace sprout { template class bitset : private sprout::detail::base_bitset< - N / (CHAR_BIT * sizeof(unsigned long)) + (N % (CHAR_BIT * sizeof(unsigned long)) == 0 ? 0 : 1) + N / (CHAR_BIT * sprout::detail::size_t_::value) + (N % (CHAR_BIT * sprout::detail::size_t_::value) == 0 ? 0 : 1) > { private: typedef sprout::detail::base_bitset< - N / (CHAR_BIT * sizeof(unsigned long)) + (N % (CHAR_BIT * sizeof(unsigned long)) == 0 ? 0 : 1) + N / (CHAR_BIT * sprout::detail::size_t_::value) + (N % (CHAR_BIT * sprout::detail::size_t_::value) == 0 ? 0 : 1) > base_type; typedef unsigned long word_type; public: @@ -949,12 +955,12 @@ namespace sprout { void do_sanitize() SPROUT_NOEXCEPT { - typedef sprout::detail::sanitize sanitize_type; + typedef sprout::detail::sanitize::value)> sanitize_type; sanitize_type::do_sanitize(this->hiword()); } SPROUT_CONSTEXPR bitset do_sanitize() const SPROUT_NOEXCEPT { - typedef sprout::detail::sanitize sanitize_type; + typedef sprout::detail::sanitize::value)> sanitize_type; return bitset(this->hiword(sanitize_type::do_sanitize_c(this->hiword()))); } SPROUT_CONSTEXPR bitset diff --git a/sprout/compost/utility/iir_filter.hpp b/sprout/compost/utility/iir_filter.hpp index c1797e7a..75e08f9b 100644 --- a/sprout/compost/utility/iir_filter.hpp +++ b/sprout/compost/utility/iir_filter.hpp @@ -23,7 +23,6 @@ namespace sprout { template inline SPROUT_CONSTEXPR typename sprout::float_promote::type iir_g(T const& g) { - typedef typename sprout::float_promote::type type; return g + 1; } } // namespace detail diff --git a/sprout/container/deep_internal.hpp b/sprout/container/deep_internal.hpp index 5e693ca1..4a53f7a5 100644 --- a/sprout/container/deep_internal.hpp +++ b/sprout/container/deep_internal.hpp @@ -18,9 +18,10 @@ namespace sprout { struct deep_internal_impl< Container, Prev, typename std::enable_if::value>::type - > - : public std::common_type - {}; + > { + public: + typedef Container type; + }; } // namespace detail // // deep_internal diff --git a/sprout/cstring/strchr.hpp b/sprout/cstring/strchr.hpp index 72628ce6..9fe0fcbf 100644 --- a/sprout/cstring/strchr.hpp +++ b/sprout/cstring/strchr.hpp @@ -37,7 +37,6 @@ namespace sprout { T const& value, typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return current.second || !*current.first ? current : sprout::detail::strchr_impl( sprout::detail::strchr_impl_1( diff --git a/sprout/cstring/strcmp.hpp b/sprout/cstring/strcmp.hpp index 13eaf3c9..3d053cab 100644 --- a/sprout/cstring/strcmp.hpp +++ b/sprout/cstring/strcmp.hpp @@ -48,7 +48,6 @@ namespace sprout { typename std::iterator_traits::difference_type n ) { - typedef sprout::tuples::tuple type; return sprout::tuples::get<2>(current) || !*sprout::tuples::get<1>(current) || !*sprout::tuples::get<0>(current) ? current : sprout::detail::strcmp_impl( sprout::detail::strcmp_impl_1( diff --git a/sprout/cstring/strcspn.hpp b/sprout/cstring/strcspn.hpp index f0f66105..3c340026 100644 --- a/sprout/cstring/strcspn.hpp +++ b/sprout/cstring/strcspn.hpp @@ -41,7 +41,6 @@ namespace sprout { ForwardIterator2 first2, typename std::iterator_traits::difference_type n ) { - typedef sprout::tuples::tuple type; return sprout::tuples::get<2>(current) || !*sprout::tuples::get<0>(current) ? current : sprout::detail::strcspn_impl( sprout::detail::strcspn_impl_1( diff --git a/sprout/cstring/strlen.hpp b/sprout/cstring/strlen.hpp index 68392c46..00afde97 100644 --- a/sprout/cstring/strlen.hpp +++ b/sprout/cstring/strlen.hpp @@ -39,7 +39,6 @@ namespace sprout { typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return !*current.first ? current : sprout::detail::strlen_impl( sprout::detail::strlen_impl_1( diff --git a/sprout/cstring/strpbrk.hpp b/sprout/cstring/strpbrk.hpp index 3cbc62ae..6d0fd199 100644 --- a/sprout/cstring/strpbrk.hpp +++ b/sprout/cstring/strpbrk.hpp @@ -42,7 +42,6 @@ namespace sprout { typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return current.second || !*current.first ? current : sprout::detail::strpbrk_impl( sprout::detail::strpbrk_impl_1( diff --git a/sprout/cstring/strrchr.hpp b/sprout/cstring/strrchr.hpp index 8a3e4840..56b6cb35 100644 --- a/sprout/cstring/strrchr.hpp +++ b/sprout/cstring/strrchr.hpp @@ -46,7 +46,6 @@ namespace sprout { typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return !*current.first ? current : sprout::detail::strrchr_impl( sprout::detail::strrchr_impl_1( diff --git a/sprout/cstring/strspn.hpp b/sprout/cstring/strspn.hpp index 1c64f9bf..79be259c 100644 --- a/sprout/cstring/strspn.hpp +++ b/sprout/cstring/strspn.hpp @@ -41,7 +41,6 @@ namespace sprout { ForwardIterator2 first2, typename std::iterator_traits::difference_type n ) { - typedef sprout::tuples::tuple type; return sprout::tuples::get<2>(current) || !*sprout::tuples::get<0>(current) ? current : sprout::detail::strspn_impl( sprout::detail::strspn_impl_1( diff --git a/sprout/cstring/strstr.hpp b/sprout/cstring/strstr.hpp index 2ebd5dae..b67542f5 100644 --- a/sprout/cstring/strstr.hpp +++ b/sprout/cstring/strstr.hpp @@ -79,7 +79,6 @@ namespace sprout { typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return current.second || !*current.first ? current : n == 1 ? sprout::detail::strstr_impl_fork( current, @@ -102,7 +101,6 @@ namespace sprout { typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return current.second || !*current.first ? current : sprout::detail::strstr_impl( sprout::detail::strstr_impl_1( diff --git a/sprout/detail/algorithm/overlap_count.hpp b/sprout/detail/algorithm/overlap_count.hpp index 3afbe712..6ee1e1e8 100644 --- a/sprout/detail/algorithm/overlap_count.hpp +++ b/sprout/detail/algorithm/overlap_count.hpp @@ -76,7 +76,6 @@ namespace sprout { InputIterator last, BinaryPredicate pred, typename std::iterator_traits::difference_type n ) { - typedef sprout::tuples::tuple::value_type, typename std::iterator_traits::difference_type> type; return sprout::tuples::get<0>(current) == last ? current : sprout::detail::overlap_count_impl( sprout::detail::overlap_count_impl_1( diff --git a/sprout/detail/algorithm/set_overlap_count.hpp b/sprout/detail/algorithm/set_overlap_count.hpp index ef5d12d0..7284de2c 100644 --- a/sprout/detail/algorithm/set_overlap_count.hpp +++ b/sprout/detail/algorithm/set_overlap_count.hpp @@ -49,7 +49,6 @@ namespace sprout { InputIterator1 last1, InputIterator2 last2, Compare comp, typename std::iterator_traits::difference_type n ) { - typedef sprout::tuples::tuple::difference_type> type; return sprout::tuples::get<0>(current) == last1 || sprout::tuples::get<1>(current) == last2 ? current : sprout::detail::set_overlap_count_impl( sprout::detail::set_overlap_count_impl_1( diff --git a/sprout/iterator/distance.hpp b/sprout/iterator/distance.hpp index 942bc0a2..6c113775 100644 --- a/sprout/iterator/distance.hpp +++ b/sprout/iterator/distance.hpp @@ -50,7 +50,6 @@ namespace sprout { InputIterator last, typename std::iterator_traits::difference_type n ) { - typedef sprout::pair::difference_type> type; return current.first == last ? current : sprout::iterator_detail::iterator_distance_impl( sprout::iterator_detail::iterator_distance_impl_1( diff --git a/sprout/numeric/accumulate.hpp b/sprout/numeric/accumulate.hpp index f97010d2..4574d833 100644 --- a/sprout/numeric/accumulate.hpp +++ b/sprout/numeric/accumulate.hpp @@ -75,7 +75,6 @@ namespace sprout { InputIterator last, BinaryOperation binary_op, typename std::iterator_traits::difference_type n ) { - typedef sprout::pair type; return current.first == last ? current : sprout::detail::accumulate_impl( sprout::detail::accumulate_impl_1( diff --git a/sprout/numeric/dft/fixed/sawtooth.hpp b/sprout/numeric/dft/fixed/sawtooth.hpp index 281f2699..4ce0112e 100644 --- a/sprout/numeric/dft/fixed/sawtooth.hpp +++ b/sprout/numeric/dft/fixed/sawtooth.hpp @@ -52,7 +52,6 @@ namespace sprout { typename sprout::container_traits::value_type const& phase ) { - typedef typename sprout::container_traits::value_type value_type; return sprout::fixed::detail::sawtooth_impl( cont, frequency, diff --git a/sprout/numeric/dft/fixed/square.hpp b/sprout/numeric/dft/fixed/square.hpp index afdccb43..a52b4ec8 100644 --- a/sprout/numeric/dft/fixed/square.hpp +++ b/sprout/numeric/dft/fixed/square.hpp @@ -53,7 +53,6 @@ namespace sprout { typename sprout::container_traits::value_type const& duty ) { - typedef typename sprout::container_traits::value_type value_type; return sprout::fixed::detail::square_impl( cont, frequency, diff --git a/sprout/numeric/dft/fixed/triangle.hpp b/sprout/numeric/dft/fixed/triangle.hpp index bb84b98c..c9a5e050 100644 --- a/sprout/numeric/dft/fixed/triangle.hpp +++ b/sprout/numeric/dft/fixed/triangle.hpp @@ -55,7 +55,6 @@ namespace sprout { typename sprout::container_traits::value_type const& phase ) { - typedef typename sprout::container_traits::value_type value_type; return sprout::fixed::detail::triangle_impl( cont, frequency, diff --git a/sprout/numeric/inner_product.hpp b/sprout/numeric/inner_product.hpp index 1eff744a..936c09eb 100644 --- a/sprout/numeric/inner_product.hpp +++ b/sprout/numeric/inner_product.hpp @@ -83,7 +83,6 @@ namespace sprout { InputIterator1 last1, BinaryOperation1 binary_op1, BinaryOperation2 binary_op2, typename std::iterator_traits::difference_type n ) { - typedef sprout::tuples::tuple type; return sprout::tuples::get<0>(current) == last1 ? current : sprout::detail::inner_product_impl( sprout::detail::inner_product_impl_1( diff --git a/sprout/random/uniform_real_distribution.hpp b/sprout/random/uniform_real_distribution.hpp index 819dc1ee..4f9bdfce 100644 --- a/sprout/random/uniform_real_distribution.hpp +++ b/sprout/random/uniform_real_distribution.hpp @@ -129,7 +129,6 @@ namespace sprout { T max_value ) { - typedef T result_type; typedef typename Engine::result_type base_result; return sprout::random::detail::generate_uniform_real_true_2( rnd.engine(), diff --git a/testspr/iterator.hpp b/testspr/iterator.hpp index dd98d1b8..d2d0b245 100644 --- a/testspr/iterator.hpp +++ b/testspr/iterator.hpp @@ -34,9 +34,7 @@ namespace testspr { iterator_type current; public: reduct_iterator() = default; - SPROUT_CONSTEXPR reduct_iterator(reduct_iterator const& other) - : current(other.current) - {} + SPROUT_CONSTEXPR reduct_iterator(reduct_iterator const& other) = default; explicit SPROUT_CONSTEXPR reduct_iterator(iterator_type it) : current(it) {}