Using std::tr1::bind with std::vector::push_back

后端 未结 4 812
孤独总比滥情好
孤独总比滥情好 2021-01-21 15:39

Why my VS2010 can\'t compile this code:

#include 
#include 
int main()
{
    std::vector vec;
    std::bind(&std::         


        
4条回答
  •  鱼传尺愫
    2021-01-21 16:30

    It should propably lok like this:

    std::vector vec;
    std::tr1::bind(&std::vector::push_back, std::tr1::ref(vec), _1)(1);
    

提交回复
热议问题