What causes std::bad_function_call?

后端 未结 4 540
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-30 19:41

I\'ve seen a few questions that refer to the std::bad_function_call exception, but haven\'t been able to find out any by Googling about what causes this exception.

W

4条回答
  •  不知归路
    2020-12-30 19:52

    in my case was the problem was in capture list. i have a recursive lambda function.

    //decl
    std::function f_build;
    f_build = [&f_build](const SBone* bone, const core::vector3df& pos, const core::quaternion& rot)
    {
    ...
    }
    

    missing & from f_build in capture list generate a bad call.

提交回复
热议问题