Boost Rtree C2228 error

Boost Rtree C2228 error

本文关键字:error C2228 Rtree Boost      更新时间:2023-10-16

我正在尝试使用boost库创建一个范围树,以下是我的代码:

#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/index/rtree.hpp>
#include <vector>
#include <iostream>
#include <boost/foreach.hpp>
namespace bg = boost::geometry;
namespace bgi = boost::geometry::index;
typedef bg::model::point<float, 2, bg::cs::cartesian> point;
typedef bg::model::box<point> box;
typedef std::pair<box, unsigned> value;
// create the rtree using default constructor
int main(){
    bgi::rtree< value, bgi::linear<16> > rtree;
return 0;
}

但是我得到这个错误:

错误1错误C2228: left of '。Select_on_container_copy_construction '必须有class/struct/union
我使用boost版本1_55_0和visual studio 2013。

我也遇到过同样的问题。这是VS 2013和Boost 1.55的一个已知问题,在这里查看bug报告。你只需要升级到更高版本的Boost

相关文章: