We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
TR1 不是 C++ 标准的一部分,任何 C++ 编译器都不需要支持 TR1。 C++11 中包含的功能(例如元组和绑定)的 TR1 版本不使用新的 C++11 语言功能,因为 TR1 指定了 C++03 编译器的库功能。例如,TR1元组不使用可变参数模板,TR1绑定不使用完美转发。
此外,TR1 功能在被纳入标准之前进行了一些更改,因此使用 TR1 的代码可能与使用 C++11 的代码不同。例如,有名称更改(例如,
uniform_int
->uniform_int_distribution
)和删除部分(例如,删除了将随机引擎绑定到分布的设施,以支持更多通用绑定工具)不幸的是,stdllibc++ 中似乎没有任何关于 TR1 支持的综合文档。如果您正在编译 C++11 功能列表,您可能根本不想包含 TR1。如果您无论如何都想包含 TR1,请记住 TR1 支持可能先于对该功能的 C++11 版本所需的语言功能的支持。
TR1 is not part of the C++ standard and support for TR1 is not required of any C++ compiler. The TR1 versions of features included in C++11, such as tuple and bind, do not use new C++11 language features because TR1 specified library features for C++03 compilers. For example, TR1 tuple does not use variadic templates and TR1 bind does not use perfect forwarding.
Also, there were some changes to TR1 features before they were adopted into the standard so code using TR1 may be different from code using C++11. For example there were name changes (E.g.,
uniform_int
->uniform_int_distribution
) and removed portions (E.g., the facility for binding random engines to distributions was removed in favor of the more general bind facility)Unfortunately there doesn't seem to be any comprehensive documentation for TR1 support in stdllibc++. If you're compiling a list of C++11 features you might not want to include TR1 at all. If you want to include TR1 anyway, remember that TR1 support could precede support for the language features required by the C++11 version of that feature.