diff options
Diffstat (limited to 'boost/algorithm/cxx14')
-rw-r--r-- | boost/algorithm/cxx14/is_permutation.hpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/boost/algorithm/cxx14/is_permutation.hpp b/boost/algorithm/cxx14/is_permutation.hpp index d8002cbce..9346881af 100644 --- a/boost/algorithm/cxx14/is_permutation.hpp +++ b/boost/algorithm/cxx14/is_permutation.hpp @@ -22,7 +22,6 @@ namespace boost { namespace algorithm { -#if __cplusplus <= 201103L /// \fn is_permutation ( ForwardIterator1 first, ForwardIterator1 last, /// ForwardIterator2 first2, ForwardIterator2 last2 ) /// \brief Tests to see if the sequence [first,last) is a permutation of the sequence starting at first2 @@ -40,10 +39,10 @@ bool is_permutation ( ForwardIterator1 first1, ForwardIterator1 last1, { // How should I deal with the idea that ForwardIterator1::value_type // and ForwardIterator2::value_type could be different? Define my own comparison predicate? - std::pair<ForwardIterator1, ForwardIterator2> eq = boost::algorithm::mismatch - ( first1, last1, first2, last2 ); - if ( eq.first == last1 && eq.second == last2) - return true; + std::pair<ForwardIterator1, ForwardIterator2> eq = boost::algorithm::mismatch + ( first1, last1, first2, last2 ); + if ( eq.first == last1 && eq.second == last2) + return true; return boost::algorithm::detail::is_permutation_tag ( eq.first, last1, eq.second, last2, std::equal_to<typename std::iterator_traits<ForwardIterator1>::value_type> (), @@ -70,16 +69,15 @@ bool is_permutation ( ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred ) { - std::pair<ForwardIterator1, ForwardIterator2> eq = boost::algorithm::mismatch - ( first1, last1, first2, last2, pred ); - if ( eq.first == last1 && eq.second == last2) - return true; + std::pair<ForwardIterator1, ForwardIterator2> eq = boost::algorithm::mismatch + ( first1, last1, first2, last2, pred ); + if ( eq.first == last1 && eq.second == last2) + return true; return boost::algorithm::detail::is_permutation_tag ( first1, last1, first2, last2, pred, typename std::iterator_traits<ForwardIterator1>::iterator_category (), typename std::iterator_traits<ForwardIterator2>::iterator_category ()); } -#endif }} |