diff --git a/include/boost/algorithm/apply_permutation.hpp b/include/boost/algorithm/apply_permutation.hpp index c844cfc..b9de0de 100644 --- a/include/boost/algorithm/apply_permutation.hpp +++ b/include/boost/algorithm/apply_permutation.hpp @@ -41,15 +41,16 @@ void apply_permutation(RandomAccessIterator1 item_begin, RandomAccessIterator1 item_end, RandomAccessIterator2 ind_begin, RandomAccessIterator2 ind_end) { - using Diff = typename std::iterator_traits::difference_type; + typedef typename std::iterator_traits::difference_type Diff; + typedef typename std::iterator_traits::difference_type Index; using std::swap; Diff size = std::distance(item_begin, item_end); for (Diff i = 0; i < size; i++) { - auto current = i; + Diff current = i; while (i != ind_begin[current]) { - auto next = ind_begin[current]; + Index next = ind_begin[current]; swap(item_begin[current], item_begin[next]); ind_begin[current] = current; current = next; @@ -75,7 +76,7 @@ apply_reverse_permutation( RandomAccessIterator2 ind_begin, RandomAccessIterator2 ind_end) { - using Diff = typename std::iterator_traits::difference_type; + typedef typename std::iterator_traits::difference_type Diff; using std::swap; Diff length = std::distance(item_begin, item_end); for (Diff i = 0; i < length; i++) diff --git a/test/apply_permutation_test.cpp b/test/apply_permutation_test.cpp index e9ab970..3dbb7e1 100644 --- a/test/apply_permutation_test.cpp +++ b/test/apply_permutation_test.cpp @@ -12,7 +12,6 @@ #include -#define BOOST_TEST_DYN_LINK #define BOOST_TEST_MAIN #include