c++ forward function call

后端 未结 3 1381
独厮守ぢ
独厮守ぢ 2021-01-26 19:01

Is it possible to transfer list of parameters of a function , to another function?

For example in my functionA I want to call my functionB/functionC (depends on the stat

3条回答
  •  萌比男神i
    2021-01-26 19:43

    You can't change the signature of B, but can you change the one of A? If so, this might be a good option:

    template 
    int functionA(Args&& ... args)
    {
        return functionB(std::forward(args)...);
    }
    

提交回复
热议问题