gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-03 07:17:38 25 4
gpt4 key购买 nike

谁能指导我如何使用 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com