follow code is compile error:
#include <iostream>
#include <vector>
#include <boost/range/adaptor/indexed.hpp>
#include <boost/range/algorithm/min_element.hpp>
int main()
{
std::vector<int> v = {3, 1, 4};
auto m = boost::min_element(v | boost::adaptors::indexed(0));
auto i = m.index();
std::cout << i << std::endl;
std::cout << *m << std::endl;
}
In file included from D:\GitHub\Boost\boost-svn/boost/range/concepts.hpp:19:0,
from D:\GitHub\Boost\boost-svn/boost/range/algorithm/equal.hpp:14,
from D:\GitHub\Boost\boost-svn/boost/range/iterator_range_core.hpp:29,
from D:\GitHub\Boost\boost-svn/boost/range/iterator_range.hpp:13,
from D:\GitHub\Boost\boost-svn/boost/range/adaptor/indexed.hpp:21,
from C:\language\cpp\main.cpp:3:
D:\GitHub\Boost\boost-svn/boost/concept_check.hpp: In instantiation of 'boost::DefaultConstructible<TT>::~DefaultConstructible() [with TT = boost::range_detail::indexed_iterator<__gnu_cxx::__normal_iterator<int*, std::vector<int> > >]':
D:\GitHub\Boost\boost-svn/boost/concept/usage.hpp:22:29: required from 'boost::concepts::usage_requirements<Model>::~usage_requirements() [with Model = boost::DefaultConstructible<boost::range_detail::indexed_iterator<__gnu_cxx::__normal_iterator<int*, std::vector<int> > > >]'
D:\GitHub\Boost\boost-svn/boost/concept/detail/general.hpp:38:28: required from 'static void boost::concepts::requirement<boost::concepts::failed************ Model::************>::failed() [with Model = boost::concepts::usage_requirements<boost::DefaultConstructible<boost::range_detail::indexed_iterator<__gnu_cxx::__normal_iterator<int*, std::vector<int> > > > >]'
...
Because indexed_iterator
hasn't default constructor.
I attach patch.
add test