From bb5936368225cb17bf726020f1bd4abc52c2ab02 Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Thu, 3 Jan 2013 17:38:45 +0900 Subject: [PATCH] fix algorithm --- sprout/algorithm/adjacent_find.hpp | 1 + sprout/algorithm/equal.hpp | 6 +++++- sprout/algorithm/find_end.hpp | 2 ++ sprout/algorithm/find_first_of.hpp | 1 + sprout/algorithm/is_permutation.hpp | 6 +++++- sprout/algorithm/mismatch.hpp | 6 +++++- 6 files changed, 19 insertions(+), 3 deletions(-) diff --git a/sprout/algorithm/adjacent_find.hpp b/sprout/algorithm/adjacent_find.hpp index 78772e67..0cfc5825 100644 --- a/sprout/algorithm/adjacent_find.hpp +++ b/sprout/algorithm/adjacent_find.hpp @@ -2,6 +2,7 @@ #define SPROUT_ALGORITHM_ADJACENT_FIND_HPP #include +#include #include #include #include diff --git a/sprout/algorithm/equal.hpp b/sprout/algorithm/equal.hpp index 3d1bafa7..db6ebd73 100644 --- a/sprout/algorithm/equal.hpp +++ b/sprout/algorithm/equal.hpp @@ -2,6 +2,7 @@ #define SPROUT_ALGORITHM_EQUAL_HPP #include +#include #include #include #include @@ -29,7 +30,10 @@ namespace sprout { ; } template - inline SPROUT_CONSTEXPR bool + inline SPROUT_CONSTEXPR typename std::enable_if< + sprout::is_constant_distance_iterator::value && sprout::is_constant_distance_iterator::value, + bool + >::type equal( RandomAccessIterator1 first1, RandomAccessIterator1 last1, RandomAccessIterator2 first2, BinaryPredicate pred, std::random_access_iterator_tag* diff --git a/sprout/algorithm/find_end.hpp b/sprout/algorithm/find_end.hpp index 4d108449..a18bcf6d 100644 --- a/sprout/algorithm/find_end.hpp +++ b/sprout/algorithm/find_end.hpp @@ -1,6 +1,8 @@ #ifndef SPROUT_ALGORITHM_FIND_END_HPP #define SPROUT_ALGORITHM_FIND_END_HPP +#include +#include #include #include #include diff --git a/sprout/algorithm/find_first_of.hpp b/sprout/algorithm/find_first_of.hpp index 8273a8bb..70057e3d 100644 --- a/sprout/algorithm/find_first_of.hpp +++ b/sprout/algorithm/find_first_of.hpp @@ -2,6 +2,7 @@ #define SPROUT_ALGORITHM_FIND_FIRST_OF_HPP #include +#include #include #include #include diff --git a/sprout/algorithm/is_permutation.hpp b/sprout/algorithm/is_permutation.hpp index 53a82882..61b940bd 100644 --- a/sprout/algorithm/is_permutation.hpp +++ b/sprout/algorithm/is_permutation.hpp @@ -2,6 +2,7 @@ #define SPROUT_ALGORITHM_IS_PERMUTATION_HPP #include +#include #include #include #include @@ -35,7 +36,10 @@ namespace sprout { ; } template - inline SPROUT_CONSTEXPR bool + inline SPROUT_CONSTEXPR typename std::enable_if< + sprout::is_constant_distance_iterator::value && sprout::is_constant_distance_iterator::value, + bool + >::type is_permutation( RandomAccessIterator1 first1, RandomAccessIterator1 last1, RandomAccessIterator2 first2, BinaryPredicate pred, std::random_access_iterator_tag* diff --git a/sprout/algorithm/mismatch.hpp b/sprout/algorithm/mismatch.hpp index da99a959..54192401 100644 --- a/sprout/algorithm/mismatch.hpp +++ b/sprout/algorithm/mismatch.hpp @@ -2,6 +2,7 @@ #define SPROUT_ALGORITHM_MISMATCH_HPP #include +#include #include #include #include @@ -39,7 +40,10 @@ namespace sprout { ; } template - inline SPROUT_CONSTEXPR sprout::pair + inline SPROUT_CONSTEXPR typename std::enable_if< + sprout::is_constant_distance_iterator::value && sprout::is_constant_distance_iterator::value, + sprout::pair + >::type mismatch( RandomAccessIterator1 first1, RandomAccessIterator1 last1, RandomAccessIterator2 first2, BinaryPredicate pred, std::random_access_iterator_tag*