将boost :: detail :: multi_array :: mutable_iterator_tag转换为std :: random_access_iterator_tag

时间:2017-07-12 14:07:38

标签: multidimensional-array boost visual-studio-2015 compiler-errors

我想使用boost boost :: dijkstra_shortest_paths算法。这段代码适用于VS 2010,但是当尝试使用VS 2015进行编译时,它提供的错误无法从boost :: detail :: multi_array :: mutable_iterator_tag转换为std :: random_access_iterator_tag

        boost::dijkstra_shortest_paths(
        _graph, source,
        boost::make_iterator_property_map(predecessor.begin(), index_map, predecessor[0]),
        boost::make_iterator_property_map(weight.begin(), index_map, weight[0]),
        weight_map, index_map,
        std::less<Weight>(), boost::closed_plus<Weight>(), 
        InfiniteWeight, 0,
        StopWhenTargetReached(target));

经过一些初步分析后发现boost::make_iterator_property_map(predecessor.begin(), index_map, predecessor[0])

给出错误。

VS 2015如何解决此错误?

1 个答案:

答案 0 :(得分:0)

我也遇到了一些&#34;魔法&#34;变化,我得到了它。

在此处查看我的评论,https://svn.boost.org/trac10/ticket/4874#comment:43

请注意免责声明说我​​不知道​​我在这里做什么。希望这只会导致有人能够提供适当的修复来提升。

相关问题