未指定的绑定 [英] unspecified bind

查看:162
本文介绍了未指定的绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在MSDN:并且看到列出的原型是:

And saw that the prototypes listed are:

template<class Fty, class T1, class T2, ..., class TN>
   unspecified bind(Fty fn, T1 t1, T2 t2, ..., TN tN);
template<class Ret, class Fty, class T1, class T2, ..., class TN>
   unspecified bind(Fty fn, T1 t1, T2 t2, ..., TN tN);

哪个使我感到困惑,有两个原因. 1)最后我检查了一下,MSVC没有实现可变参数模板,并且2)我的问题:unspecified词在这里是什么意思? (这似乎与未指定的行为无关.)

Which confuses me for two reasons. 1) Last I checked, MSVC didn't implement variadic templates, and 2) My question: what does the word unspecified mean there? (It doesn't seem related to unspecified behavior.)

推荐答案

返回类型中的 unspecified 表示它是未指定的类型.该标准不需要从bind返回特定类型,只要返回的类型符合该标准规定的要求即可.

The unspecified in the return type means that it is a type that is, well, unspecified. The standard does not require a particular type to be returned from bind, as long as the returned type complies with the requirements that the standard mandates.

...开始,我不知道VS是否实现了它们,但是您会看到boost::bind的相同文档,并且它已经在不同版本的编译器中编译了一段时间,而这些版本没有可变参数模板支持...文档说明您可以传递不同类型的N参数,但这并不一定意味着只有一个模板可以执行此操作,可以按照一组1-ary,2- ary ... N-ary模板.

As of the ..., I don't know whether VS implements them or not, but you will see the same documentation for boost::bind, and it has been compiling in different compilers without variadic template support for some time already... the documentation states that you can pass N arguments of different types, but that does not necessarily mean that there is a single template that does it, it can be implemented in terms of a set of 1-ary, 2-ary... N-ary templates.

文档显示的是您预期会使用该软件的行为,而不是其实现方式的详细信息.

The documentation is showing the behavior that you can expect from using it, rather than the detail of how it is implemented.

这篇关于未指定的绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆