Boost logo

Boost Users :

From: Jeff Flinn - wwnet (jflinn_at_[hidden])
Date: 2002-02-18 11:32:08

I'm trying to use the Permutation Iterator adaptor on MSV++ w/SP5 with
boost_1_27_0. Below is a simplification of the example on the web site,
which results in the compiler error found below function main: Any ideas?

#include <list>
#include <vector>
#include <boost/permutation_iterator.hpp>

int main(int argc, char* argv[])
   typedef std::vector < int > tElements; typedef
tElements::iterator tEItr;
   typedef std::list < int > tIdxs; typedef
tIdxs::iterator tIItr;
   typedef std::ostream_iterator< int > tOItr;

   tElements elements( 1, 1 );
   tIdxs indices ( 1, 1 );

   typedef boost::permutation_iterator_generator< tEItr, tIItr >::type

   tPItr begin = boost::make_permutation_iterator( elements.begin(),
indices.begin() );

   int val = *begin;

 return 0;

error C2440: 'initializing' : cannot convert
from 'struct boost::detail::iterator_traits_::undefined<void>'
to 'int'
        Source or target has incomplete type

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at