您好!欢迎来到聚码网

聚码网

热门搜索: 相亲小程序    搭子源码    直播系统自有商城   
  • c++-bind如何自己实现?
  • 聚码交流
  • 0 1
  • yhuxAvNbtxUM
    0000-00-00 00:00:00
  • 回帖
//---------------------------1-------------------template<int_Nx>struct_Ph{//placeholder};//-----------------2-------------------------------//TEMPLATEFUNCTIONbind(explicitreturntype)template<class_Ret,class_Fx,class..._Types>inline_Binder<_Ret,_Fx,_Types...>bind(_Fx&&_Func,_Types&&..._Args){//bindacallableobjectwithanexplicitreturntypereturn(_Binder<_Ret,_Fx,_Types...>(_STDforward<_Fx>(_Func),_STDforward<_Types>(_Args)...));}///--------------------------3------------------------//PLACEHOLDERARGUMENTSnamespaceplaceholders{//placeholdersconstexpr_Ph<1>_1{};constexpr_Ph<2>_2{};constexpr_Ph<3>_3{};constexpr_Ph<4>_4{};constexpr_Ph<5>_5{};constexpr_Ph<6>_6{};constexpr_Ph<7>_7{};constexpr_Ph<8>_8{};constexpr_Ph<9>_9{};constexpr_Ph<10>_10{};constexpr_Ph<11>_11{};constexpr_Ph<12>_12{};constexpr_Ph<13>_13{};constexpr_Ph<14>_14{};constexpr_Ph<15>_15{};constexpr_Ph<16>_16{};constexpr_Ph<17>_17{};constexpr_Ph<18>_18{};constexpr_Ph<19>_19{};constexpr_Ph<20>_20{};}//namespaceplaceholders中间那段代码不懂,它是怎么搭配第3部分实现的?谁可以写的简单点的bind,谢谢了。
最近热帖
近期热议
联系我们
Q Q:317563994
电话:400-000-000
邮箱:317563994@qq.com
时间:09:00 - 17:00