课堂笔记

//函数调用 bind&function 
void fun(){ CCLOG("Hello cocos"); return; } std::function<void()> f = std::bind(fun); fun();

-------------------

void fun1(){
    int number = 8;
   // auto fc = [&](int i){
   auto fc = [=](int i)mutable{
        number++;
        return i+number;
        
       
    };
    
    cout<<fc(6);
}

  

//获得MenuItemFont得文件名

void SceneB:: onSelectFile(Ref *obj){ MenuItemFont *it1 = (MenuItemFont *) obj; Label *lable = (Label*)it1->getLabel(); CCLOG("%s",lable->getString().c_str() ); }

  

std::function<void(std::string)> f;//->函数对象

  

 

 

 

 

 

 

 

 

 

 

 

 

 

 

posted @ 2014-06-18 17:53  f(x)=f(x-1)  阅读(125)  评论(0)    收藏  举报