I've discovered the difference between the http://www.boost.org/libs/utility/permutation_iterator.htm example and the http://www.boost.org/libs/utility/iterator_adaptor_test.cpp test code is that the former (along with the example below) use vector<int> as the element_range_type, while the latter uses deque<int>. In my environment, permutation iterator works when used with deques but doesn't compile using vector as exhibited below. I've copied the test case and replaced deque with vector reproducing the problem.
Again the compiler complains about "struct boost::detail::iterator_traits_::undefined<void>". Since Toon says that
From: "Jeff Flinn - wwnet"
below code works with with gcc-2.95.3 as well as gcc-3.0.3, does any one know of MSVC vector issues that could be the source of this problem? I will try this using MSVC and STLPORT this evening on another machine to see if the problem persists.
A possible cause of this problem is that vector iterators are plain pointers in MSVC 6, and iterator_traits doesn't handle pointers on this compiler (no partial specialization.)