c++ - 为 std::bind 创建模板包装器
问题描述
我正在尝试为 std::bind 创建一个简单的包装函数,它将采用一个成员函数。
template<typename T, typename F>
void myBindFunction(T &t)
{
std::bind(T::F, t );
}
MyClass a = MyClass();
myBindFunction <MyClass, &MyClass::m_Function>( a );
我不确定我想要实现的目标是否可行?
解决方案
推荐阅读
- javascript - 为引导程序制作自定义网格结构?
- postgresql - 如何在 Postgres 中存储社交媒体 Unix 时间戳,保留用户的本地时间
- scala - Gatling - 如何在 Scala 中设置 Gatling 控制台日志级别
- java - 在 call() 方法的返回语句执行之前具有对象引用的未来对象
- javascript - TinyMCE 在编辑器中显示错误
- javascript - 是否可以使用 `require.context` 为 Webpack 进行动态导入?
- spring - Spring中原型bean的@component和@scope之间的区别
- google-chrome - 内嵌 Chrome 扩展程序下载不会添加到网上商店计数中
- selenium - 在调用另一个函数期间,我在线程“main”java.lang.NullPointerException 中收到“timeoutException”
- delphi - Delphi 使用 ScaleBy 和 Margin 进行缩放