【问题标题】:Boost Rtree C2228 errorBoost Rtree C2228 错误
【发布时间】:2015-09-10 11:51:21
【问题描述】:

我正在尝试使用 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:“.select_on_container_copy_construction”左侧必须有类/结构/联合
我正在使用 boost 版本 1_55_0 和 Visual Studio 2013。

【问题讨论】:

    标签: c++ boost


    【解决方案1】:

    我也遇到过同样的问题。这是 VS 2013 和 Boost 1.55 的一个已知问题,请查看 bug report here。您只需升级到更高版本的 Boost。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-09-21
      • 1970-01-01
      • 2021-05-23
      • 2015-09-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多