Passing rvalues through std::bind

后端 未结 5 1626
醉话见心
醉话见心 2020-11-29 06:12

I want to pass an rvalue through std::bind to a function that takes an rvalue reference in C++0x. I can\'t figure out how to do it. For example:



        
5条回答
  •  情歌与酒
    2020-11-29 06:25

    You could use a lambda expression.

    auto f = [](){ foo(Movable()); };
    

    This would seem to be the simplest option.

提交回复
热议问题