template pass by value or const reference or…?

后端 未结 5 2009
既然无缘
既然无缘 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:08

    Besides what James McNellis wrote, I just want to add that you can specialize your template for reference types (for example like this)

提交回复
热议问题