c++ - view_as 在 Boost Polygon 库中的使用

标签 c++ boost boost-polygon

谁能指导我如何使用 view_as。或者也许是 boost 多边形库中的示例?

在文档中,提到我们可以从一个类型转换为另一个类型。

http://www.boost.org/doc/libs/1_58_0/libs/polygon/doc/gtl_polygon_90_concept.htm

最佳答案

boost::polygon 文档不是很好,但至少在这方面它看起来相当清楚:

An object that is a model of polygon_90_concept can be viewed as a model of any of its refinements if it is determined at runtime to conform to the restriction of those concepts. This concept casting is accomplished through the view_as<>() function.

view_as<rectangle_concept>(polygon_90_object)

The return value of view_as<>() can be passed into any interface that expects an object of the conceptual type specified in its template parameter.

关于c++ - view_as 在 Boost Polygon 库中的使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31182791/

相关文章:

C++ - 从 BMP 文件中读取每像素的位数

c++ - 可以使用函数局部类作为 find_if 的谓词吗?

c++ - 将多个内部类型转换为系统级类型

c++ - std::reverse_iterator 的缺点是什么?

c++ - 使用 Boost.Polygon 对曼哈顿多边形进行切片

c++ - 使用 boost 生成一组矩形以在不规则多边形中形成网格

c++ - 使用 Copliens 1994 计数指针示例代码获取编译错误

c++ - 类自引用问题

c++ - 如何处理打开和关闭 boost iostreams 设备?

C++:从带孔的多边形中获取简单多边形的列表