c++ template casting

后端 未结 7 1155
伪装坚强ぢ
伪装坚强ぢ 2021-01-06 13:48

I\'m a little lost in how to cast templates. I have a function foo which takes a parameter of type ParamVector*. I would like to pass in a P

7条回答
  •  失恋的感觉
    2021-01-06 13:58

    You mentioned "template casting" in your headline, so I'll presume that ParamVector is a templated type. That means that foo could be templated as well, and that would solve your problem.

    template 
    void foo(ParamVector const& data)
    {
    }
    

提交回复
热议问题