template pass by value or const reference or…?

后端 未结 5 2022
既然无缘
既然无缘 2020-12-09 20:31

I can write a templated function this way

template void f(T x) {…}

or this way

template void f(T         


        
5条回答
  •  离开以前
    2020-12-09 21:13

    boost::traits has a type trait that selects the "best" type, based on T:

    call_traits::param_type

    As already mentioned, there are no template-specific issues.

提交回复
热议问题