From 41916cf0a56f8542e4b45d7101a792d1bb1a4652 Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Fri, 28 Oct 2011 23:28:24 +0900 Subject: [PATCH] =?UTF-8?q?algorithm/*=20=E5=AE=9F=E8=A3=85=E5=A4=89?= =?UTF-8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sprout/algorithm/fixed/merge.hpp | 101 +++------------- sprout/algorithm/fixed/partition_copy.hpp | 1 - sprout/algorithm/fixed/set_difference.hpp | 103 +++-------------- sprout/algorithm/fixed/set_intersection.hpp | 103 +++-------------- .../fixed/set_symmetric_difference.hpp | 103 +++-------------- sprout/algorithm/fixed/set_union.hpp | 103 +++-------------- sprout/algorithm/fixed/sort.hpp | 59 ++++++++-- .../algorithm/fixed/stable_partition_copy.hpp | 108 ++++-------------- sprout/algorithm/fixed/swap_element_copy.hpp | 102 ++--------------- 9 files changed, 164 insertions(+), 619 deletions(-) diff --git a/sprout/algorithm/fixed/merge.hpp b/sprout/algorithm/fixed/merge.hpp index 27ad86e7..a5b27f28 100644 --- a/sprout/algorithm/fixed/merge.hpp +++ b/sprout/algorithm/fixed/merge.hpp @@ -1,52 +1,30 @@ #ifndef SPROUT_ALGORITHM_FIXED_MERGE_HPP #define SPROUT_ALGORITHM_FIXED_MERGE_HPP -#include #include #include #include #include #include #include +#include #include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT_DETAIL namespace sprout { namespace fixed { namespace detail { - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size == sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type merge_impl_3( - Result const& result, - Args const&... args - ) - { - return sprout::remake_clone(result, sprout::size(result), args...); - } - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size != sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type merge_impl_3( - Result const& result, - Args const&... args - ) - { - return merge_impl_3(result, args..., *sprout::next(sprout::fixed_begin(result), sizeof...(Args))); - } template SPROUT_CONSTEXPR inline typename std::enable_if< sprout::fixed_container_traits::fixed_size == sizeof...(Args), typename sprout::fixed::result_of::algorithm::type - >::type merge_impl_2( + >::type merge_impl( InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Result const& result, Compare comp, - typename sprout::fixed_container_traits::difference_type offset, + typename sprout::fixed_container_traits::size_type size, Args const&... args ) { @@ -56,79 +34,30 @@ namespace sprout { SPROUT_CONSTEXPR inline typename std::enable_if< sprout::fixed_container_traits::fixed_size != sizeof...(Args), typename sprout::fixed::result_of::algorithm::type - >::type merge_impl_2( + >::type merge_impl( InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Result const& result, Compare comp, - typename sprout::fixed_container_traits::difference_type offset, + typename sprout::fixed_container_traits::size_type size, Args const&... args ) { - return sizeof...(Args) < static_cast(offset) + return sizeof...(Args) < size ? first1 != last1 ? first2 != last2 ? comp(*first2, *first1) - ? merge_impl_2(first1, last1, sprout::next(first2), last2, result, comp, offset, args..., *first2) - : merge_impl_2(sprout::next(first1), last1, first2, last2, result, comp, offset, args..., *first1) - : merge_impl_2(sprout::next(first1), last1, first2, last2, result, comp, offset, args..., *first1) + ? sprout::fixed::detail::merge_impl(first1, last1, sprout::next(first2), last2, result, comp, size, args..., *first2) + : sprout::fixed::detail::merge_impl(sprout::next(first1), last1, first2, last2, result, comp, size, args..., *first1) + : sprout::fixed::detail::merge_impl(sprout::next(first1), last1, first2, last2, result, comp, size, args..., *first1) : first2 != last2 - ? merge_impl_2(first1, last1, sprout::next(first2), last2, result, comp, offset, args..., *first2) - : merge_impl_3(result, args...) - : merge_impl_3(result, args...) + ? sprout::fixed::detail::merge_impl(first1, last1, sprout::next(first2), last2, result, comp, size, args..., *first2) + : sprout::detail::container_complate(result, args...) + : sprout::detail::container_complate(result, args...) ; } - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size == sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type merge_impl_1( - InputIterator1 first1, - InputIterator1 last1, - InputIterator2 first2, - InputIterator2 last2, - Result const& result, - Compare comp, - typename sprout::fixed_container_traits::difference_type offset, - Args const&... args - ) - { - return sprout::remake_clone(result, sprout::size(result), args...); - } - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size != sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type merge_impl_1( - InputIterator1 first1, - InputIterator1 last1, - InputIterator2 first2, - InputIterator2 last2, - Result const& result, - Compare comp, - typename sprout::fixed_container_traits::difference_type offset, - Args const&... args - ) - { - return sizeof...(Args) < static_cast(offset) - ? merge_impl_1(first1, last1, first2, last2, result, comp, offset, args..., *sprout::next(sprout::fixed_begin(result), sizeof...(Args))) - : merge_impl_2(first1, last1, first2, last2, result, comp, offset + sprout::size(result), args...) - ; - } - template - SPROUT_CONSTEXPR inline typename sprout::fixed::result_of::algorithm::type merge_impl( - InputIterator1 first1, - InputIterator1 last1, - InputIterator2 first2, - InputIterator2 last2, - Result const& result, - Compare comp - ) - { - return merge_impl_1(first1, last1, first2, last2, result, comp, sprout::fixed_begin_offset(result)); - } } // namespace detail // // merge @@ -149,7 +78,8 @@ namespace sprout { first2, last2, result, - comp + comp, + sprout::size(result) ); } // @@ -170,7 +100,8 @@ namespace sprout { first2, last2, result, - NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less::value_type>() + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less::value_type>(), + sprout::size(result) ); } } // namespace fixed diff --git a/sprout/algorithm/fixed/partition_copy.hpp b/sprout/algorithm/fixed/partition_copy.hpp index c27f9e17..01007f29 100644 --- a/sprout/algorithm/fixed/partition_copy.hpp +++ b/sprout/algorithm/fixed/partition_copy.hpp @@ -1,7 +1,6 @@ #ifndef SPROUT_ALGORITHM_FIXED_PARTITION_COPY_HPP #define SPROUT_ALGORITHM_FIXED_PARTITION_COPY_HPP -#include #include #include #include diff --git a/sprout/algorithm/fixed/set_difference.hpp b/sprout/algorithm/fixed/set_difference.hpp index 095eae3e..9604b6ba 100644 --- a/sprout/algorithm/fixed/set_difference.hpp +++ b/sprout/algorithm/fixed/set_difference.hpp @@ -1,52 +1,30 @@ #ifndef SPROUT_ALGORITHM_FIXED_SET_DIFFERENCE_HPP #define SPROUT_ALGORITHM_FIXED_SET_DIFFERENCE_HPP -#include #include #include #include #include #include #include +#include #include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT_DETAIL namespace sprout { namespace fixed { namespace detail { - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size == sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type set_difference_impl_3( - Result const& result, - Args const&... args - ) - { - return sprout::remake_clone(result, sprout::size(result), args...); - } - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size != sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type set_difference_impl_3( - Result const& result, - Args const&... args - ) - { - return set_difference_impl_3(result, args..., *sprout::next(sprout::fixed_begin(result), sizeof...(Args))); - } template SPROUT_CONSTEXPR inline typename std::enable_if< sprout::fixed_container_traits::fixed_size == sizeof...(Args), typename sprout::fixed::result_of::algorithm::type - >::type set_difference_impl_2( + >::type set_difference_impl( InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Result const& result, Compare comp, - typename sprout::fixed_container_traits::difference_type offset, + typename sprout::fixed_container_traits::size_type size, Args const&... args ) { @@ -56,81 +34,32 @@ namespace sprout { SPROUT_CONSTEXPR inline typename std::enable_if< sprout::fixed_container_traits::fixed_size != sizeof...(Args), typename sprout::fixed::result_of::algorithm::type - >::type set_difference_impl_2( + >::type set_difference_impl( InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Result const& result, Compare comp, - typename sprout::fixed_container_traits::difference_type offset, + typename sprout::fixed_container_traits::size_type size, Args const&... args ) { - return sizeof...(Args) < static_cast(offset) + return sizeof...(Args) < size ? first1 != last1 ? first2 != last2 ? comp(*first1, *first2) - ? set_difference_impl_2(sprout::next(first1), last1, first2, last2, result, comp, offset, args..., *first1) + ? sprout::fixed::detail::set_difference_impl(sprout::next(first1), last1, first2, last2, result, comp, size, args..., *first1) : comp(*first2, *first1) - ? set_difference_impl_2(first1, last1, sprout::next(first2), last2, result, comp, offset, args...) - : set_difference_impl_2(sprout::next(first1), last1, sprout::next(first2), last2, result, comp, offset, args...) - : set_difference_impl_2(sprout::next(first1), last1, first2, last2, result, comp, offset, args..., *first1) + ? sprout::fixed::detail::set_difference_impl(first1, last1, sprout::next(first2), last2, result, comp, size, args...) + : sprout::fixed::detail::set_difference_impl(sprout::next(first1), last1, sprout::next(first2), last2, result, comp, size, args...) + : sprout::fixed::detail::set_difference_impl(sprout::next(first1), last1, first2, last2, result, comp, size, args..., *first1) : first2 != last2 - ? set_difference_impl_2(first1, last1, sprout::next(first2), last2, result, comp, offset, args...) - : set_difference_impl_3(result, args...) - : set_difference_impl_3(result, args...) + ? sprout::fixed::detail::set_difference_impl(first1, last1, sprout::next(first2), last2, result, comp, size, args...) + : sprout::detail::container_complate(result, args...) + : sprout::detail::container_complate(result, args...) ; } - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size == sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type set_difference_impl_1( - InputIterator1 first1, - InputIterator1 last1, - InputIterator2 first2, - InputIterator2 last2, - Result const& result, - Compare comp, - typename sprout::fixed_container_traits::difference_type offset, - Args const&... args - ) - { - return sprout::remake_clone(result, sprout::size(result), args...); - } - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size != sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type set_difference_impl_1( - InputIterator1 first1, - InputIterator1 last1, - InputIterator2 first2, - InputIterator2 last2, - Result const& result, - Compare comp, - typename sprout::fixed_container_traits::difference_type offset, - Args const&... args - ) - { - return sizeof...(Args) < static_cast(offset) - ? set_difference_impl_1(first1, last1, first2, last2, result, comp, offset, args..., *sprout::next(sprout::fixed_begin(result), sizeof...(Args))) - : set_difference_impl_2(first1, last1, first2, last2, result, comp, offset + sprout::size(result), args...) - ; - } - template - SPROUT_CONSTEXPR inline typename sprout::fixed::result_of::algorithm::type set_difference_impl( - InputIterator1 first1, - InputIterator1 last1, - InputIterator2 first2, - InputIterator2 last2, - Result const& result, - Compare comp - ) - { - return set_difference_impl_1(first1, last1, first2, last2, result, comp, sprout::fixed_begin_offset(result)); - } } // namespace detail // // set_difference @@ -151,7 +80,8 @@ namespace sprout { first2, last2, result, - comp + comp, + sprout::size(result) ); } // @@ -172,7 +102,8 @@ namespace sprout { first2, last2, result, - NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less::value_type>() + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less::value_type>(), + sprout::size(result) ); } } // namespace fixed diff --git a/sprout/algorithm/fixed/set_intersection.hpp b/sprout/algorithm/fixed/set_intersection.hpp index 3081cfe3..77d5d4a6 100644 --- a/sprout/algorithm/fixed/set_intersection.hpp +++ b/sprout/algorithm/fixed/set_intersection.hpp @@ -1,52 +1,30 @@ #ifndef SPROUT_ALGORITHM_FIXED_SET_INTERSECTION_HPP #define SPROUT_ALGORITHM_FIXED_SET_INTERSECTION_HPP -#include #include #include #include #include #include #include +#include #include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT_DETAIL namespace sprout { namespace fixed { namespace detail { - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size == sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type set_intersection_impl_3( - Result const& result, - Args const&... args - ) - { - return sprout::remake_clone(result, sprout::size(result), args...); - } - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size != sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type set_intersection_impl_3( - Result const& result, - Args const&... args - ) - { - return set_intersection_impl_3(result, args..., *sprout::next(sprout::fixed_begin(result), sizeof...(Args))); - } template SPROUT_CONSTEXPR inline typename std::enable_if< sprout::fixed_container_traits::fixed_size == sizeof...(Args), typename sprout::fixed::result_of::algorithm::type - >::type set_intersection_impl_2( + >::type set_intersection_impl( InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Result const& result, Compare comp, - typename sprout::fixed_container_traits::difference_type offset, + typename sprout::fixed_container_traits::size_type size, Args const&... args ) { @@ -56,81 +34,32 @@ namespace sprout { SPROUT_CONSTEXPR inline typename std::enable_if< sprout::fixed_container_traits::fixed_size != sizeof...(Args), typename sprout::fixed::result_of::algorithm::type - >::type set_intersection_impl_2( + >::type set_intersection_impl( InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Result const& result, Compare comp, - typename sprout::fixed_container_traits::difference_type offset, + typename sprout::fixed_container_traits::size_type size, Args const&... args ) { - return sizeof...(Args) < static_cast(offset) + return sizeof...(Args) < size ? first1 != last1 ? first2 != last2 ? comp(*first1, *first2) - ? set_intersection_impl_2(sprout::next(first1), last1, first2, last2, result, comp, offset, args...) + ? sprout::fixed::detail::set_intersection_impl(sprout::next(first1), last1, first2, last2, result, comp, size, args...) : comp(*first2, *first1) - ? set_intersection_impl_2(first1, last1, sprout::next(first2), last2, result, comp, offset, args...) - : set_intersection_impl_2(sprout::next(first1), last1, sprout::next(first2), last2, result, comp, offset, args..., *first1) - : set_intersection_impl_2(sprout::next(first1), last1, first2, last2, result, comp, offset, args...) + ? sprout::fixed::detail::set_intersection_impl(first1, last1, sprout::next(first2), last2, result, comp, size, args...) + : sprout::fixed::detail::set_intersection_impl(sprout::next(first1), last1, sprout::next(first2), last2, result, comp, size, args..., *first1) + : sprout::fixed::detail::set_intersection_impl(sprout::next(first1), last1, first2, last2, result, comp, size, args...) : first2 != last2 - ? set_intersection_impl_2(first1, last1, sprout::next(first2), last2, result, comp, offset, args...) - : set_intersection_impl_3(result, args...) - : set_intersection_impl_3(result, args...) + ? sprout::fixed::detail::set_intersection_impl(first1, last1, sprout::next(first2), last2, result, comp, size, args...) + : sprout::detail::container_complate(result, args...) + : sprout::detail::container_complate(result, args...) ; } - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size == sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type set_intersection_impl_1( - InputIterator1 first1, - InputIterator1 last1, - InputIterator2 first2, - InputIterator2 last2, - Result const& result, - Compare comp, - typename sprout::fixed_container_traits::difference_type offset, - Args const&... args - ) - { - return sprout::remake_clone(result, sprout::size(result), args...); - } - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size != sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type set_intersection_impl_1( - InputIterator1 first1, - InputIterator1 last1, - InputIterator2 first2, - InputIterator2 last2, - Result const& result, - Compare comp, - typename sprout::fixed_container_traits::difference_type offset, - Args const&... args - ) - { - return sizeof...(Args) < static_cast(offset) - ? set_intersection_impl_1(first1, last1, first2, last2, result, comp, offset, args..., *sprout::next(sprout::fixed_begin(result), sizeof...(Args))) - : set_intersection_impl_2(first1, last1, first2, last2, result, comp, offset + sprout::size(result), args...) - ; - } - template - SPROUT_CONSTEXPR inline typename sprout::fixed::result_of::algorithm::type set_intersection_impl( - InputIterator1 first1, - InputIterator1 last1, - InputIterator2 first2, - InputIterator2 last2, - Result const& result, - Compare comp - ) - { - return set_intersection_impl_1(first1, last1, first2, last2, result, comp, sprout::fixed_begin_offset(result)); - } } // namespace detail // // set_intersection @@ -151,7 +80,8 @@ namespace sprout { first2, last2, result, - comp + comp, + sprout::size(result) ); } // @@ -172,7 +102,8 @@ namespace sprout { first2, last2, result, - NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less::value_type>() + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less::value_type>(), + sprout::size(result) ); } } // namespace fixed diff --git a/sprout/algorithm/fixed/set_symmetric_difference.hpp b/sprout/algorithm/fixed/set_symmetric_difference.hpp index 08c5fc6c..838aba4f 100644 --- a/sprout/algorithm/fixed/set_symmetric_difference.hpp +++ b/sprout/algorithm/fixed/set_symmetric_difference.hpp @@ -1,52 +1,30 @@ #ifndef SPROUT_ALGORITHM_FIXED_SET_SYMMETRIC_DIFFERENCE_HPP #define SPROUT_ALGORITHM_FIXED_SET_SYMMETRIC_DIFFERENCE_HPP -#include #include #include #include #include #include #include +#include #include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT_DETAIL namespace sprout { namespace fixed { namespace detail { - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size == sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type set_symmetric_difference_impl_3( - Result const& result, - Args const&... args - ) - { - return sprout::remake_clone(result, sprout::size(result), args...); - } - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size != sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type set_symmetric_difference_impl_3( - Result const& result, - Args const&... args - ) - { - return set_symmetric_difference_impl_3(result, args..., *sprout::next(sprout::fixed_begin(result), sizeof...(Args))); - } template SPROUT_CONSTEXPR inline typename std::enable_if< sprout::fixed_container_traits::fixed_size == sizeof...(Args), typename sprout::fixed::result_of::algorithm::type - >::type set_symmetric_difference_impl_2( + >::type set_symmetric_difference_impl( InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Result const& result, Compare comp, - typename sprout::fixed_container_traits::difference_type offset, + typename sprout::fixed_container_traits::size_type size, Args const&... args ) { @@ -56,81 +34,32 @@ namespace sprout { SPROUT_CONSTEXPR inline typename std::enable_if< sprout::fixed_container_traits::fixed_size != sizeof...(Args), typename sprout::fixed::result_of::algorithm::type - >::type set_symmetric_difference_impl_2( + >::type set_symmetric_difference_impl( InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Result const& result, Compare comp, - typename sprout::fixed_container_traits::difference_type offset, + typename sprout::fixed_container_traits::size_type size, Args const&... args ) { - return sizeof...(Args) < static_cast(offset) + return sizeof...(Args) < size ? first1 != last1 ? first2 != last2 ? comp(*first1, *first2) - ? set_symmetric_difference_impl_2(sprout::next(first1), last1, first2, last2, result, comp, offset, args..., *first1) + ? sprout::fixed::detail::set_symmetric_difference_impl(sprout::next(first1), last1, first2, last2, result, comp, size, args..., *first1) : comp(*first2, *first1) - ? set_symmetric_difference_impl_2(first1, last1, sprout::next(first2), last2, result, comp, offset, args..., *first2) - : set_symmetric_difference_impl_2(sprout::next(first1), last1, sprout::next(first2), last2, result, comp, offset, args...) - : set_symmetric_difference_impl_2(sprout::next(first1), last1, first2, last2, result, comp, offset, args..., *first1) + ? sprout::fixed::detail::set_symmetric_difference_impl(first1, last1, sprout::next(first2), last2, result, comp, size, args..., *first2) + : sprout::fixed::detail::set_symmetric_difference_impl(sprout::next(first1), last1, sprout::next(first2), last2, result, comp, size, args...) + : sprout::fixed::detail::set_symmetric_difference_impl(sprout::next(first1), last1, first2, last2, result, comp, size, args..., *first1) : first2 != last2 - ? set_symmetric_difference_impl_2(first1, last1, sprout::next(first2), last2, result, comp, offset, args..., *first2) - : set_symmetric_difference_impl_3(result, args...) - : set_symmetric_difference_impl_3(result, args...) + ? sprout::fixed::detail::set_symmetric_difference_impl(first1, last1, sprout::next(first2), last2, result, comp, size, args..., *first2) + : sprout::detail::container_complate(result, args...) + : sprout::detail::container_complate(result, args...) ; } - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size == sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type set_symmetric_difference_impl_1( - InputIterator1 first1, - InputIterator1 last1, - InputIterator2 first2, - InputIterator2 last2, - Result const& result, - Compare comp, - typename sprout::fixed_container_traits::difference_type offset, - Args const&... args - ) - { - return sprout::remake_clone(result, sprout::size(result), args...); - } - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size != sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type set_symmetric_difference_impl_1( - InputIterator1 first1, - InputIterator1 last1, - InputIterator2 first2, - InputIterator2 last2, - Result const& result, - Compare comp, - typename sprout::fixed_container_traits::difference_type offset, - Args const&... args - ) - { - return sizeof...(Args) < static_cast(offset) - ? set_symmetric_difference_impl_1(first1, last1, first2, last2, result, comp, offset, args..., *sprout::next(sprout::fixed_begin(result), sizeof...(Args))) - : set_symmetric_difference_impl_2(first1, last1, first2, last2, result, comp, offset + sprout::size(result), args...) - ; - } - template - SPROUT_CONSTEXPR inline typename sprout::fixed::result_of::algorithm::type set_symmetric_difference_impl( - InputIterator1 first1, - InputIterator1 last1, - InputIterator2 first2, - InputIterator2 last2, - Result const& result, - Compare comp - ) - { - return set_symmetric_difference_impl_1(first1, last1, first2, last2, result, comp, sprout::fixed_begin_offset(result)); - } } // namespace detail // // set_symmetric_difference @@ -151,7 +80,8 @@ namespace sprout { first2, last2, result, - comp + comp, + sprout::size(result) ); } // @@ -172,7 +102,8 @@ namespace sprout { first2, last2, result, - NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less::value_type>() + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less::value_type>(), + sprout::size(result) ); } } // namespace fixed diff --git a/sprout/algorithm/fixed/set_union.hpp b/sprout/algorithm/fixed/set_union.hpp index e87f3d6b..2a353d4a 100644 --- a/sprout/algorithm/fixed/set_union.hpp +++ b/sprout/algorithm/fixed/set_union.hpp @@ -1,52 +1,30 @@ #ifndef SPROUT_ALGORITHM_FIXED_SET_UNION_HPP #define SPROUT_ALGORITHM_FIXED_SET_UNION_HPP -#include #include #include #include #include #include #include +#include #include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT_DETAIL namespace sprout { namespace fixed { namespace detail { - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size == sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type set_union_impl_3( - Result const& result, - Args const&... args - ) - { - return sprout::remake_clone(result, sprout::size(result), args...); - } - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size != sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type set_union_impl_3( - Result const& result, - Args const&... args - ) - { - return set_union_impl_3(result, args..., *sprout::next(sprout::fixed_begin(result), sizeof...(Args))); - } template SPROUT_CONSTEXPR inline typename std::enable_if< sprout::fixed_container_traits::fixed_size == sizeof...(Args), typename sprout::fixed::result_of::algorithm::type - >::type set_union_impl_2( + >::type set_union_impl( InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Result const& result, Compare comp, - typename sprout::fixed_container_traits::difference_type offset, + typename sprout::fixed_container_traits::size_type size, Args const&... args ) { @@ -56,81 +34,32 @@ namespace sprout { SPROUT_CONSTEXPR inline typename std::enable_if< sprout::fixed_container_traits::fixed_size != sizeof...(Args), typename sprout::fixed::result_of::algorithm::type - >::type set_union_impl_2( + >::type set_union_impl( InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Result const& result, Compare comp, - typename sprout::fixed_container_traits::difference_type offset, + typename sprout::fixed_container_traits::size_type size, Args const&... args ) { - return sizeof...(Args) < static_cast(offset) + return sizeof...(Args) < size ? first1 != last1 ? first2 != last2 ? comp(*first1, *first2) - ? set_union_impl_2(sprout::next(first1), last1, first2, last2, result, comp, offset, args..., *first1) + ? sprout::fixed::detail::set_union_impl(sprout::next(first1), last1, first2, last2, result, comp, size, args..., *first1) : comp(*first2, *first1) - ? set_union_impl_2(first1, last1, sprout::next(first2), last2, result, comp, offset, args..., *first2) - : set_union_impl_2(sprout::next(first1), last1, sprout::next(first2), last2, result, comp, offset, args..., *first1) - : set_union_impl_2(sprout::next(first1), last1, first2, last2, result, comp, offset, args..., *first1) + ? sprout::fixed::detail::set_union_impl(first1, last1, sprout::next(first2), last2, result, comp, size, args..., *first2) + : sprout::fixed::detail::set_union_impl(sprout::next(first1), last1, sprout::next(first2), last2, result, comp, size, args..., *first1) + : sprout::fixed::detail::set_union_impl(sprout::next(first1), last1, first2, last2, result, comp, size, args..., *first1) : first2 != last2 - ? set_union_impl_2(first1, last1, sprout::next(first2), last2, result, comp, offset, args..., *first2) - : set_union_impl_3(result, args...) - : set_union_impl_3(result, args...) + ? sprout::fixed::detail::set_union_impl(first1, last1, sprout::next(first2), last2, result, comp, size, args..., *first2) + : sprout::detail::container_complate(result, args...) + : sprout::detail::container_complate(result, args...) ; } - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size == sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type set_union_impl_1( - InputIterator1 first1, - InputIterator1 last1, - InputIterator2 first2, - InputIterator2 last2, - Result const& result, - Compare comp, - typename sprout::fixed_container_traits::difference_type offset, - Args const&... args - ) - { - return sprout::remake_clone(result, sprout::size(result), args...); - } - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size != sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type set_union_impl_1( - InputIterator1 first1, - InputIterator1 last1, - InputIterator2 first2, - InputIterator2 last2, - Result const& result, - Compare comp, - typename sprout::fixed_container_traits::difference_type offset, - Args const&... args - ) - { - return sizeof...(Args) < static_cast(offset) - ? set_union_impl_1(first1, last1, first2, last2, result, comp, offset, args..., *sprout::next(sprout::fixed_begin(result), sizeof...(Args))) - : set_union_impl_2(first1, last1, first2, last2, result, comp, offset + sprout::size(result), args...) - ; - } - template - SPROUT_CONSTEXPR inline typename sprout::fixed::result_of::algorithm::type set_union_impl( - InputIterator1 first1, - InputIterator1 last1, - InputIterator2 first2, - InputIterator2 last2, - Result const& result, - Compare comp - ) - { - return set_union_impl_1(first1, last1, first2, last2, result, comp, sprout::fixed_begin_offset(result)); - } } // namespace detail // // set_union @@ -151,7 +80,8 @@ namespace sprout { first2, last2, result, - comp + comp, + sprout::size(result) ); } // @@ -172,7 +102,8 @@ namespace sprout { first2, last2, result, - NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less::value_type>() + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less::value_type>(), + sprout::size(result) ); } } // namespace fixed diff --git a/sprout/algorithm/fixed/sort.hpp b/sprout/algorithm/fixed/sort.hpp index 60cf08ab..cce15122 100644 --- a/sprout/algorithm/fixed/sort.hpp +++ b/sprout/algorithm/fixed/sort.hpp @@ -49,7 +49,10 @@ namespace sprout { typename sprout::fixed_container_traits::value_type const& p ) { // left を見つける - return comp(*sprout::next(origin, l), p) ? sort_find_l(origin, comp, l + 1, p) : l; + return comp(*sprout::next(origin, l), p) + ? sprout::fixed::detail::sort_find_l(origin, comp, l + 1, p) + : l + ; } template SPROUT_CONSTEXPR inline typename sprout::fixed_container_traits::difference_type sort_find_r( @@ -59,7 +62,10 @@ namespace sprout { typename sprout::fixed_container_traits::value_type const& p ) { // right を見つける - return comp(p, *sprout::next(origin, r)) ? sort_find_r(origin, comp, r - 1, p) : r; + return comp(p, *sprout::next(origin, r)) + ? sprout::fixed::detail::sort_find_r(origin, comp, r - 1, p) + : r + ; } template SPROUT_CONSTEXPR inline typename sprout::fixed::result_of::algorithm::type swap_lr( @@ -75,7 +81,10 @@ namespace sprout { typename sprout::fixed_container_traits::difference_type l ) { // 左側をソート - return start < l - 1 ? sort_start(cont, start, l - 1, comp) : sprout::clone(cont); + return start < l - 1 + ? sprout::fixed::detail::sort_start(cont, start, l - 1, comp) + : sprout::clone(cont) + ; } template SPROUT_CONSTEXPR inline typename sprout::fixed::result_of::algorithm::type sort_part_r( @@ -85,7 +94,10 @@ namespace sprout { typename sprout::fixed_container_traits::difference_type r ) { // 右側をソート - return r + 1 < end ? sort_start(cont, r + 1, end, comp) : sprout::clone(cont); + return r + 1 < end + ? sprout::fixed::detail::sort_start(cont, r + 1, end, comp) + : sprout::clone(cont) + ; } template SPROUT_CONSTEXPR inline typename sprout::fixed::result_of::algorithm::type sort_part_lr( @@ -97,7 +109,12 @@ namespace sprout { typename sprout::fixed_container_traits::difference_type r ) { // 左右に分けてソート - return sort_part_r(sort_part_l(cont, start, comp, l), end, comp, r); + return sprout::fixed::detail::sort_part_r( + sprout::fixed::detail::sort_part_l(cont, start, comp, l), + end, + comp, + r + ); } template SPROUT_CONSTEXPR inline typename sprout::fixed::result_of::algorithm::type sort_next( @@ -111,8 +128,20 @@ namespace sprout { ) { // left と right 比較して、左右に分けてソートするか、またはスワップしてこの範囲のソートを続ける return l >= r - ? sort_part_lr(cont, start, end, comp, l, r) - : sort_lr(sprout::fixed::swap_element(cont, sprout::next(sprout::fixed_begin(cont), l), sprout::next(sprout::fixed_begin(cont), r)), start, end, comp, l + 1, r - 1, p) + ? sprout::fixed::detail::sort_part_lr(cont, start, end, comp, l, r) + : sprout::fixed::detail::sort_lr( + sprout::fixed::swap_element( + cont, + sprout::next(sprout::fixed_begin(cont), l), + sprout::next(sprout::fixed_begin(cont), r) + ), + start, + end, + comp, + l + 1, + r - 1, + p + ) ; } template @@ -126,13 +155,13 @@ namespace sprout { typename sprout::fixed_container_traits::value_type const& p ) { // left と right を検索 - return sort_next( + return sprout::fixed::detail::sort_next( cont, start, end, comp, - sort_find_l(sprout::fixed_begin(cont), comp, l, p), - sort_find_r(sprout::fixed_begin(cont), comp, r, p), + sprout::fixed::detail::sort_find_l(sprout::fixed_begin(cont), comp, l, p), + sprout::fixed::detail::sort_find_r(sprout::fixed_begin(cont), comp, r, p), p ); } @@ -144,7 +173,15 @@ namespace sprout { Compare comp ) { // pivot を選択してソートを開始 - return sort_lr(cont, start, end, comp, start, end, sort_select_pivot(sprout::fixed_begin(cont), start, end)); + return sprout::fixed::detail::sort_lr( + cont, + start, + end, + comp, + start, + end, + sprout::fixed::detail::sort_select_pivot(sprout::fixed_begin(cont), start, end) + ); } template SPROUT_CONSTEXPR inline typename std::enable_if< diff --git a/sprout/algorithm/fixed/stable_partition_copy.hpp b/sprout/algorithm/fixed/stable_partition_copy.hpp index 09f297c5..35c9d7fb 100644 --- a/sprout/algorithm/fixed/stable_partition_copy.hpp +++ b/sprout/algorithm/fixed/stable_partition_copy.hpp @@ -1,50 +1,27 @@ #ifndef SPROUT_ALGORITHM_FIXED_STABLE_PARTITION_COPY_HPP #define SPROUT_ALGORITHM_FIXED_STABLE_PARTITION_COPY_HPP -#include #include #include #include #include #include #include +#include namespace sprout { namespace fixed { namespace detail { - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size == sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type stable_partition_copy_impl_4( - Result const& result, - Args const&... args - ) - { - return sprout::remake_clone(result, sprout::size(result), args...); - } - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size != sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type stable_partition_copy_impl_4( - Result const& result, - Args const&... args - ) - { - return stable_partition_copy_impl_4(result, args..., *sprout::next(sprout::fixed_begin(result), sizeof...(Args))); - } - template SPROUT_CONSTEXPR inline typename std::enable_if< sprout::fixed_container_traits::fixed_size == sizeof...(Args), typename sprout::fixed::result_of::algorithm::type - >::type stable_partition_copy_impl_3( + >::type stable_partition_copy_impl_1( BidirectionalIterator first, BidirectionalIterator last, Result const& result, Predicate pred, - typename sprout::fixed_container_traits::difference_type offset, + typename sprout::fixed_container_traits::size_type size, Args const&... args ) { @@ -54,20 +31,20 @@ namespace sprout { SPROUT_CONSTEXPR inline typename std::enable_if< sprout::fixed_container_traits::fixed_size != sizeof...(Args), typename sprout::fixed::result_of::algorithm::type - >::type stable_partition_copy_impl_3( + >::type stable_partition_copy_impl_1( BidirectionalIterator first, BidirectionalIterator last, Result const& result, Predicate pred, - typename sprout::fixed_container_traits::difference_type offset, + typename sprout::fixed_container_traits::size_type size, Args const&... args ) { - return first != last && sizeof...(Args) < static_cast(offset) + return first != last && sizeof...(Args) < size ? !pred(*first) - ? stable_partition_copy_impl_3(sprout::next(first), last, result, pred, offset, args..., *first) - : stable_partition_copy_impl_3(sprout::next(first), last, result, pred, offset, args...) - : stable_partition_copy_impl_4(result, args...) + ? sprout::fixed::detail::stable_partition_copy_impl_1(sprout::next(first), last, result, pred, size, args..., *first) + : sprout::fixed::detail::stable_partition_copy_impl_1(sprout::next(first), last, result, pred, size, args...) + : sprout::detail::container_complate(result, args...) ; } @@ -75,13 +52,13 @@ namespace sprout { SPROUT_CONSTEXPR inline typename std::enable_if< sprout::fixed_container_traits::fixed_size == sizeof...(Args), typename sprout::fixed::result_of::algorithm::type - >::type stable_partition_copy_impl_2( + >::type stable_partition_copy_impl( BidirectionalIterator first, BidirectionalIterator last, Result const& result, Predicate pred, - typename sprout::fixed_container_traits::difference_type offset, - BidirectionalIterator origin, + typename sprout::fixed_container_traits::size_type size, + BidirectionalIterator temp_first, Args const&... args ) { @@ -91,68 +68,23 @@ namespace sprout { SPROUT_CONSTEXPR inline typename std::enable_if< sprout::fixed_container_traits::fixed_size != sizeof...(Args), typename sprout::fixed::result_of::algorithm::type - >::type stable_partition_copy_impl_2( + >::type stable_partition_copy_impl( BidirectionalIterator first, BidirectionalIterator last, Result const& result, Predicate pred, - typename sprout::fixed_container_traits::difference_type offset, - BidirectionalIterator origin, + typename sprout::fixed_container_traits::size_type size, + BidirectionalIterator temp_first, Args const&... args ) { - return first != last && sizeof...(Args) < static_cast(offset) + return first != last && sizeof...(Args) < size ? pred(*first) - ? stable_partition_copy_impl_2(sprout::next(first), last, result, pred, offset, origin, args..., *first) - : stable_partition_copy_impl_2(sprout::next(first), last, result, pred, offset, origin, args...) - : stable_partition_copy_impl_3(origin, last, result, pred, offset, args...) - ; - } - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size == sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type stable_partition_copy_impl_1( - BidirectionalIterator first, - BidirectionalIterator last, - Result const& result, - Predicate pred, - typename sprout::fixed_container_traits::difference_type offset, - BidirectionalIterator origin, - Args const&... args - ) - { - return sprout::remake_clone(result, sprout::size(result), args...); - } - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size != sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type stable_partition_copy_impl_1( - BidirectionalIterator first, - BidirectionalIterator last, - Result const& result, - Predicate pred, - typename sprout::fixed_container_traits::difference_type offset, - BidirectionalIterator origin, - Args const&... args - ) - { - return sizeof...(Args) < static_cast(offset) - ? stable_partition_copy_impl_1(first, last, result, pred, offset, origin, args..., *sprout::next(sprout::fixed_begin(result), sizeof...(Args))) - : stable_partition_copy_impl_2(first, last, result, pred, offset + sprout::size(result), origin, args...) + ? sprout::fixed::detail::stable_partition_copy_impl(sprout::next(first), last, result, pred, size, temp_first, args..., *first) + : sprout::fixed::detail::stable_partition_copy_impl(sprout::next(first), last, result, pred, size, temp_first, args...) + : sprout::fixed::detail::stable_partition_copy_impl_1(temp_first, last, result, pred, size, args...) ; } - template - SPROUT_CONSTEXPR inline typename sprout::fixed::result_of::algorithm::type stable_partition_copy_impl( - BidirectionalIterator first, - BidirectionalIterator last, - Result const& result, - Predicate pred - ) - { - return stable_partition_copy_impl_1(first, last, result, pred, sprout::fixed_begin_offset(result), first); - } } // namespace detail // // stable_partition_copy @@ -165,7 +97,7 @@ namespace sprout { Predicate pred ) { - return sprout::fixed::detail::stable_partition_copy_impl(first, last, result, pred); + return sprout::fixed::detail::stable_partition_copy_impl(first, last, result, pred, sprout::size(result), first); } } // namespace fixed diff --git a/sprout/algorithm/fixed/swap_element_copy.hpp b/sprout/algorithm/fixed/swap_element_copy.hpp index a32b636f..fe0f3b43 100644 --- a/sprout/algorithm/fixed/swap_element_copy.hpp +++ b/sprout/algorithm/fixed/swap_element_copy.hpp @@ -10,6 +10,7 @@ #include #include #include +#include #include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL namespace sprout { @@ -20,9 +21,9 @@ namespace sprout { RandomAccessIterator first, RandomAccessIterator last, Result const& result, - sprout::index_tuple, RandomAccessIterator pos1, RandomAccessIterator pos2, + sprout::index_tuple, typename sprout::fixed_container_traits::difference_type offset, typename sprout::fixed_container_traits::size_type size, typename sprout::fixed_container_traits::size_type input_size @@ -55,82 +56,25 @@ namespace sprout { first, last, result, - typename sprout::index_range<0, sprout::fixed_container_traits::fixed_size>::type(), pos1, pos2, + typename sprout::index_range<0, sprout::fixed_container_traits::fixed_size>::type(), sprout::fixed_begin_offset(result), sprout::size(result), NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first, last) ); } - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size == sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type swap_element_copy_impl_3( - Result const& result, - Args const&... args - ) - { - return sprout::remake_clone(result, sprout::size(result), args...); - } - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size != sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type swap_element_copy_impl_3( - Result const& result, - Args const&... args - ) - { - return swap_element_copy_impl_3(result, args..., *sprout::next(sprout::fixed_begin(result), sizeof...(Args))); - } - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size == sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type swap_element_copy_impl_2( - InputIterator first, - InputIterator last, - Result const& result, - InputIterator pos1, - InputIterator pos2, - typename sprout::fixed_container_traits::difference_type offset, - Args const&... args - ) - { - return sprout::remake_clone(result, sprout::size(result), args...); - } - template - SPROUT_CONSTEXPR inline typename std::enable_if< - sprout::fixed_container_traits::fixed_size != sizeof...(Args), - typename sprout::fixed::result_of::algorithm::type - >::type swap_element_copy_impl_2( - InputIterator first, - InputIterator last, - Result const& result, - InputIterator pos1, - InputIterator pos2, - typename sprout::fixed_container_traits::difference_type offset, - Args const&... args - ) - { - return first != last && sizeof...(Args) < static_cast(offset) - ? swap_element_copy_impl_2(sprout::next(first), last, result, pos1, pos2, offset, args..., first == pos1 ? *pos2 : first == pos2 ? *pos1 : *first) - : swap_element_copy_impl_3(result, args...) - ; - } template SPROUT_CONSTEXPR inline typename std::enable_if< sprout::fixed_container_traits::fixed_size == sizeof...(Args), typename sprout::fixed::result_of::algorithm::type - >::type swap_element_copy_impl_1( + >::type swap_element_copy_impl( InputIterator first, InputIterator last, Result const& result, InputIterator pos1, InputIterator pos2, - typename sprout::fixed_container_traits::difference_type offset, + typename sprout::fixed_container_traits::size_type size, Args const&... args ) { @@ -140,33 +84,22 @@ namespace sprout { SPROUT_CONSTEXPR inline typename std::enable_if< sprout::fixed_container_traits::fixed_size != sizeof...(Args), typename sprout::fixed::result_of::algorithm::type - >::type swap_element_copy_impl_1( + >::type swap_element_copy_impl( InputIterator first, InputIterator last, Result const& result, InputIterator pos1, InputIterator pos2, - typename sprout::fixed_container_traits::difference_type offset, + typename sprout::fixed_container_traits::size_type size, Args const&... args ) { - return sizeof...(Args) < static_cast(offset) - ? swap_element_copy_impl_1(first, last, result, pos1, pos2, offset, args..., *sprout::next(sprout::fixed_begin(result), sizeof...(Args))) - : swap_element_copy_impl_2(first, last, result, pos1, pos2, offset + sprout::size(result), args...) + return first != last && sizeof...(Args) < size + ? sprout::fixed::detail::swap_element_copy_impl(sprout::next(first), last, result, pos1, pos2, size, args..., first == pos1 ? *pos2 : first == pos2 ? *pos1 : *first) + : sprout::detail::container_complate(result, args...) ; } template - SPROUT_CONSTEXPR inline typename sprout::fixed::result_of::algorithm::type swap_element_copy_impl( - InputIterator first, - InputIterator last, - Result const& result, - InputIterator pos1, - InputIterator pos2 - ) - { - return swap_element_copy_impl_1(first, last, result, pos1, pos2, pos1, pos2, sprout::fixed_begin_offset(result)); - } - template SPROUT_CONSTEXPR inline typename sprout::fixed::result_of::algorithm::type swap_element_copy( InputIterator first, InputIterator last, @@ -176,11 +109,7 @@ namespace sprout { void* ) { - return sprout::fixed::detail::swap_element_copy_impl( - first, - last, - result - ); + return sprout::fixed::detail::swap_element_copy_impl(first, last, result, sprout::size(result)); } } // namespace detail // @@ -196,14 +125,7 @@ namespace sprout { ) { typedef typename std::iterator_traits::iterator_category* category; - return sprout::fixed::detail::swap_element_copy( - first, - last, - result, - pos1, - pos2, - category() - ); + return sprout::fixed::detail::swap_element_copy(first, last, result, pos1, pos2, category()); } } // namespace fixed