We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#include <iostream> template <float a> float qwq() { return a; } template <double foo> double awa() { return foo; } int main(int argc, char* argv[]) { std::cout << qwq<3.14F>() << '\n' << awa<6.28>() << '\n'; return 0; }
以上代码编译通过。 IDE:Microsoft Visual Studio Community 2019 16.9.0 Preview 2.0 编译器:msvc(启用 预览 - 最新 C++ 工作草案中的功能 (/std:c++latest))
Microsoft Visual Studio Community 2019 16.9.0 Preview 2.0
msvc
预览 - 最新 C++ 工作草案中的功能 (/std:c++latest)
The text was updated successfully, but these errors were encountered:
值得注意的是,允许模板参数是浮点类型和有条件的字面类型,是 C++20 的 feature 。但在作者写的时候这个 feature 可能还没有确定下来,故没有提及,而且可能也不适合在一开始就提及。
另外,建议先确定这个 feature 是否以及在哪个版本钦定的,而不建议通过部分编译器的行为来验证。而且正如在 名称查找 那一节所提及的,MSVC 的行为可能与标准有所不同,更不建议作为验证 feature 的方式。
Sorry, something went wrong.
值得注意的是,允许模板参数是浮点类型和有条件的字面类型,是 C++20 的 feature 。但在作者写的时候这个 feature 可能还没有确定下来,故没有提及,而且可能也不适合在一开始就提及。 另外,建议先确定这个 feature 是否以及在哪个版本钦定的,而不建议通过部分编译器的行为来验证。而且正如在 名称查找 那一节所提及的,MSVC 的行为可能与标准有所不同,更不建议作为验证 feature 的方式。
额好吧(╯▽╰)
谢谢♪(・ω・)ノ
No branches or pull requests
以上代码编译通过。
IDE:
Microsoft Visual Studio Community 2019 16.9.0 Preview 2.0
编译器:
msvc
(启用预览 - 最新 C++ 工作草案中的功能 (/std:c++latest)
)The text was updated successfully, but these errors were encountered: