- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 boost::geometry::index::rtree
但出现以下错误 left of'.select_on_container_copy_construction' must have class/struct/union/inside文件 has_member_function_callable_with.hpp
这是我的代码:
class A;
typedef boost::intrusive_ptr<A> SharedA;
typedef boost::geometry::model::box<Vector2f> Box2D;
namespace boost {
namespace geometry {
namespace traits {
template<typename _Scalar, int _Cols>
struct tag<Vector<_Scalar, _Cols> >
{
typedef point_tag type;
};
template<typename _Scalar, int _Cols>
struct coordinate_type<Vector<_Scalar, _Cols> >
{
typedef _Scalar type;
};
template<typename _Scalar, int _Cols>
struct coordinate_system<Vector<_Scalar, _Cols> >
{
typedef cs::cartesian type;
};
template<typename _Scalar, int _Cols>
struct dimension<Vector<_Scalar, _Cols> > : boost::mpl::int_<_Cols>{};
template<typename _Scalar, int _Cols, std::size_t Dimension>
struct access<Vector<_Scalar, _Cols>, Dimension>
{
static inline _Scalar get(Vector<_Scalar, _Cols> const &matrix)
{
return matrix[Dimension];
}
static inline void set(Vector<_Scalar, _Cols> &matrix, _Scalar const &value)
{
matrix[Dimension] = value;
}
};
}
namespace index {
// apparently necessary:
template <typename Box>
struct indexable< boost::intrusive_ptr<Box> >
{
typedef boost::intrusive_ptr<Box> V;
typedef Box2D const& result_type;
result_type operator()(V const& v) const { return v->getBox(); }
};
}
}
}
class A {
public:
Vector3f position;
float distance;
const Box2D& getBox() const {
Box2D box(Vector2f(position[0] - distance, position[1] - distance), Vector2f(position[0] + distance, position[1] + distance));
return const_cast<Box2D&>(box);
}
}
class Tree {
private:
boost::geometry::index::rtree<SharedA, boost::geometry::index::rstar<16, 4>> tree;
}
输出:
1> tree.cpp
1>x\include\boost\intrusive\detail\has_member_function_callable_with.hpp(200): error C2228: left of '.select_on_container_copy_construction' must have class/struct/union
1> type is 'boost::move_detail::add_rvalue_reference<U>::type'
1> x\include\boost\intrusive\detail\has_member_function_callable_with.hpp(276) : see reference to class template instantiation 'boost::container::container_detail::has_member_function_callable_with_select_on_container_copy_construction_impl<Fun,true,>' being compiled
1> with
1> [
1> Fun=std::allocator<boost::geometry::index::detail::rtree::dynamic_leaf<boost::intrusive_ptr<A>,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>,boost::geometry::index::detail::rtree::allocators<std::allocator<SharedA>,boost::intrusive_ptr<A>,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>>
1> ]
1> x\include\boost\container\allocator_traits.hpp(262) : see reference to class template instantiation 'boost::container::container_detail::has_member_function_callable_with_select_on_container_copy_construction<const Alloc,>' being compiled
1> with
1> [
1> Alloc=std::allocator<boost::geometry::index::detail::rtree::dynamic_leaf<boost::intrusive_ptr<A>,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>,boost::geometry::index::detail::rtree::allocators<std::allocator<SharedA>,boost::intrusive_ptr<A>,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>>
1> ]
1> x\include\boost\geometry\index\detail\rtree\node\node_d_mem_dynamic.hpp(257) : see reference to class template instantiation 'boost::container::allocator_traits<AllocNode>' being compiled
1> with
1> [
1> AllocNode=std::allocator<boost::geometry::index::detail::rtree::dynamic_leaf<boost::intrusive_ptr<A>,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>,boost::geometry::index::detail::rtree::allocators<std::allocator<SharedA>,boost::intrusive_ptr<A>,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>>
1> ]
1> x\include\boost\geometry\index\detail\rtree\node\node_d_mem_dynamic.hpp(320) : see reference to function template instantiation 'BaseNodePtr boost::geometry::index::detail::rtree::create_dynamic_node<BaseNodePtr,boost::geometry::index::detail::rtree::dynamic_leaf<Value,Parameters,Box,Allocators,boost::geometry::index::detail::rtree::node_d_mem_static_tag>>::apply<std::allocator<_Other>>(AllocNode &)' being compiled
1> with
1> [
1> BaseNodePtr=boost::geometry::index::detail::rtree::dynamic_node<boost::intrusive_ptr<A>,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>,boost::geometry::index::detail::rtree::allocators<std::allocator<SharedA>,boost::intrusive_ptr<A>,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>,boost::geometry::index::detail::rtree::node_d_mem_static_tag> *
1> , Value=boost::intrusive_ptr<A>
1> , Parameters=boost::geometry::index::rstar<16,4,4,32>
1> , Box=boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>
1> , Allocators=boost::geometry::index::detail::rtree::allocators<std::allocator<SharedA>,boost::intrusive_ptr<A>,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>
1> , _Other=boost::geometry::index::detail::rtree::dynamic_leaf<boost::intrusive_ptr<A>,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>,boost::geometry::index::detail::rtree::allocators<std::allocator<SharedA>,boost::intrusive_ptr<A>,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>
1> , AllocNode=std::allocator<boost::geometry::index::detail::rtree::dynamic_leaf<boost::intrusive_ptr<A>,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>,boost::geometry::index::detail::rtree::allocators<std::allocator<SharedA>,boost::intrusive_ptr<A>,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>>
1> ]
1> x\include\boost\geometry\index\detail\rtree\node\node_d_mem_dynamic.hpp(320) : see reference to function template instantiation 'BaseNodePtr boost::geometry::index::detail::rtree::create_dynamic_node<BaseNodePtr,boost::geometry::index::detail::rtree::dynamic_leaf<Value,Parameters,Box,Allocators,boost::geometry::index::detail::rtree::node_d_mem_static_tag>>::apply<std::allocator<_Other>>(AllocNode &)' being compiled
1> with
1> [
1> BaseNodePtr=boost::geometry::index::detail::rtree::dynamic_node<boost::intrusive_ptr<A>,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>,boost::geometry::index::detail::rtree::allocators<std::allocator<SharedA>,boost::intrusive_ptr<A>,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>,boost::geometry::index::detail::rtree::node_d_mem_static_tag> *
1> , Value=boost::intrusive_ptr<A>
1> , Parameters=boost::geometry::index::rstar<16,4,4,32>
1> , Box=boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>
1> , Allocators=boost::geometry::index::detail::rtree::allocators<std::allocator<SharedA>,boost::intrusive_ptr<A>,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>
1> , _Other=boost::geometry::index::detail::rtree::dynamic_leaf<boost::intrusive_ptr<A>,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>,boost::geometry::index::detail::rtree::allocators<std::allocator<SharedA>,boost::intrusive_ptr<A>,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>
1> , AllocNode=std::allocator<boost::geometry::index::detail::rtree::dynamic_leaf<boost::intrusive_ptr<A>,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>,boost::geometry::index::detail::rtree::allocators<std::allocator<SharedA>,boost::intrusive_ptr<A>,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>>
1> ]
1> x\include\boost\geometry\index\detail\rtree\node\node_d_mem_dynamic.hpp(316) : while compiling class template member function 'boost::geometry::index::detail::rtree::dynamic_node<Value,Parameters,Box,Allocators,boost::geometry::index::detail::rtree::node_d_mem_static_tag> *boost::geometry::index::detail::rtree::create_node<Allocators,boost::geometry::index::detail::rtree::dynamic_leaf<Value,Parameters,Box,Allocators,boost::geometry::index::detail::rtree::node_d_mem_static_tag>>::apply(Allocators &)'
1> with
1> [
1> Value=boost::intrusive_ptr<A>
1> , Parameters=boost::geometry::index::rstar<16,4,4,32>
1> , Box=boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>
1> , Allocators=boost::geometry::index::detail::rtree::allocators<std::allocator<SharedA>,boost::intrusive_ptr<A>,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>
1> ]
1> x\include\boost\geometry\index\rtree.hpp(1267) : see reference to function template instantiation 'boost::geometry::index::detail::rtree::dynamic_node<Value,Parameters,Box,Allocators,boost::geometry::index::detail::rtree::node_d_mem_static_tag> *boost::geometry::index::detail::rtree::create_node<Allocators,boost::geometry::index::detail::rtree::dynamic_leaf<Value,Parameters,Box,Allocators,boost::geometry::index::detail::rtree::node_d_mem_static_tag>>::apply(Allocators &)' being compiled
1> with
1> [
1> Value=boost::intrusive_ptr<A>
1> , Parameters=boost::geometry::index::rstar<16,4,4,32>
1> , Box=boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>
1> , Allocators=boost::geometry::index::detail::rtree::allocators<std::allocator<SharedA>,boost::intrusive_ptr<A>,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>
1> ]
1> x\include\boost\geometry\index\rtree.hpp(1267) : see reference to class template instantiation 'boost::geometry::index::detail::rtree::create_node<boost::geometry::index::detail::rtree::allocators<std::allocator<_Ty>,boost::intrusive_ptr<A>,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>,boost::geometry::index::detail::rtree::dynamic_leaf<Value,Parameters,Box,Allocators,boost::geometry::index::detail::rtree::node_d_mem_static_tag>>' being compiled
1> with
1> [
1> _Ty=SharedA
1> , Value=boost::intrusive_ptr<A>
1> , Parameters=boost::geometry::index::rstar<16,4,4,32>
1> , Box=boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>
1> , Allocators=boost::geometry::index::detail::rtree::allocators<std::allocator<SharedA>,boost::intrusive_ptr<A>,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::model::box<boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>
1> ]
1> x\include\boost\geometry\index\rtree.hpp(1264) : while compiling class template member function 'void boost::geometry::index::rtree<SharedA,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::index::indexable<Value>,boost::geometry::index::equal_to<Value>,std::allocator<_Ty>>::raw_create(void)'
1> with
1> [
1> Value=SharedA
1> , _Ty=SharedA
1> ]
1> x\include\boost\geometry\index\rtree.hpp(544) : see reference to function template instantiation 'void boost::geometry::index::rtree<SharedA,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::index::indexable<Value>,boost::geometry::index::equal_to<Value>,std::allocator<_Ty>>::raw_create(void)' being compiled
1> with
1> [
1> Value=SharedA
1> , _Ty=SharedA
1> ]
1> x\src\tree.h(35) : see reference to class template instantiation 'boost::geometry::index::rtree<SharedA,boost::geometry::index::rstar<16,4,4,32>,boost::geometry::index::indexable<Value>,boost::geometry::index::equal_to<Value>,std::allocator<_Ty>>' being compiled
1> with
1> [
1> Value=SharedA
1> , _Ty=SharedA
1> ]
我找不到我做错了什么。
最佳答案
这似乎是 boost 1.55.0 中的错误,升级到 1.56.0(仍然是测试版)似乎可以解决这个问题。
关于.select_on_container_copy_construction 左侧的 C++ boost::geometry::index::rtree 必须具有类/结构/union ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24838004/
我正在尝试使用 SQLyog IDE 在 mySql 中执行复制表到不同的主机/数据库,并且在复制具有 2 个几何字段的表时遇到以下错误: Cannot get geometry object fro
我正在通过来自空间表的SQL查询创建一个新表: CREATE TABLE SomeShapes AS SELECT ash.id, ash.Geometry FROM AllShapes ash WH
考虑以下场景:给定 n 个 Polygon2D 节点,它们的行为类似于“阴影”(黑色,alpha 值减半),如何使用 merge_polygons_2d() 方法将所有这些节点组合成一个 Polygo
我最近升级到 MySQL 5.7,并试图从 5.6 master 运行复制。但是,复制失败并出现以下错误: Error 'Cannot get geometry object from data yo
我在 SQLite 数据库中存储了几何数据,列的数据类型是 BLOB。 我使用以下方法将 BLOB 数据转换为清晰的 map 几何图形 SharpMap.Converters.WellKnownBin
我有两个问题: 1.) 我刚刚找到了 boost 1.53 Polygon 实现(在 http://www.boost.org/doc/libs/1_53_0/libs/polygon 上)并且想测试
我正在尝试将一些 Geometry 加载和处理卸载到 web worker 中。要将其发送回主线程,需要对 Geometry 实例进行序列化,而且 Geometry.prototype.toJSON(
对于可定制的激光切割抽屉项目,我希望能够以编程方式在任意两个相交的垂直“2D”对象(具有宽度)之间创建连接。为此,我需要: 以某种标准格式加载和保存 2D 对象。 挤出二维对象,并对二维对象进行标
我试图找到多边形内部的线串部分。我尝试了 intersection 函数,但它似乎只是找到实际的交点,而不是与多边形重叠的线串部分。有没有办法得到这个对象? 这是一个演示情况: #include #
我正在尝试使用 NHibernate.Spatial.MySQL(版本 4.0.4.4001)创建一个简单的演示解决方案。解决方案可以在这里找到:https://github.com/andrerav
我有一些数据库使用 MySQL 中的 POINT 字段来存储几何数据。所有数据都以相同的方式添加: GeomFromText( 'POINT( lat lng )' ) 除了一个数据库外,所有数据库的
我有一个专栏让我对 MySQL Server 5.7.11 感到头疼。 它是 POINT 类型,我可以毫无问题地将其更改为 GEOMETRY 类型。 当我现在尝试将其从 GEOMETRY 更改为 PO
据我了解,您可以使用以下方法访问网格每个顶点的 uv 坐标(“纹素”): geometry.faceVertexUvs[ materialIndex ][ faceIndex ][ vertexInd
我很快就会遇到一个有趣的问题,我已经开始考虑算法了。我越想越害怕,因为我认为它会扩展得非常可怕 (O(n^4)),除非我能变聪明。我很难理解这个。这是问题的简化描述。 我有 N 个多边形(其中 N 可
给定二维平面中的 2 个点,这两个点内有多少个格点? 例如,对于 A (3, 3) 和 B (-1, -1),输出为 5。点是: (-1, -1), (0, 0), (1, 1), (2 , 2) 和
我有两个三角形,可以是任何大小。问题是,如何将坐标从一个三角形转移到另一个三角形?我知道坐标系中的两个三角形位置,是的,它们都在一个系统中。 基本上,我在triangle1中有点,我需要将它转移到tr
我有一些 线路 他们的交集描述了一个多边形,如下所示: 我知道线条的顺序,以及它们的方程。 为了找到内角,我找到了每条线的方向。但是我很困惑,因为减去两条线的方向会给出两个不同的角度,即使我是按照多边
线(x1,y1),(x2,y2)和(x3,y3),(x4,y4)是垂直的。我有点坐标 (x1, y1), (x2, y2), (x3, y3) 和线的长度 (x3, y3), (x4, y4)。我需要
在 N (~ 500) 维中,我希望找出最大的球体或矩形,使球体/矩形不包含现有的点。整个点集以轴对齐的矩形框为界(值的下限和上限)。 是否有任何已知的多项式时间方法/代码可以用来解决我的问题? 两个
我有以下代码: #include using namespace irr; using namespace core; using namespace scene; using namespace
我是一名优秀的程序员,十分优秀!