简体   繁体   English

C++WinRT中的.Net Double.PositiveInfinity等价物是什么?

[英]What is the equivalent of .Net Double.PositiveInfinity in C++WinRT?

If at all there is.如果有的话。 And if not, what should be passed to functions like如果没有,应该将什么传递给函数,例如

var tb = new TextBlock { Text = "Text", FontSize = 10 };
tb.Measure(new Size(Double.PositiveInfinity, Double.PositiveInfinity));

The purpose of the C++/WinRT projection is to let you use Windows Runtime APIs from 'Standard C++'. C++/WinRT 投影的目的是让您使用来自“标准 C++”的 Windows 运行时 API。 Always start with who the C++17 Standard would have you do it.总是从 C++17 标准会让你做的人开始。

#include <cmath>

// std::numeric_limits<float>::infinity();
// std::numeric_limits<double>::infinity();

See cppreference参见cppreference

There is a drop-list on many Microsoft Doc pages which let you set the examples to C++/WinRT instead of C#:许多 Microsoft Doc 页面上有一个下拉列表,可让您将示例设置为 C++/WinRT 而不是 C#:

选择 W++/WinRT

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM