how to query if(T==int) with template class

前端 未结 9 1750
猫巷女王i
猫巷女王i 2020-12-13 19:43

When I\'m writing a function in a template class how can I find out what my T is?

e.g.

template 
ostream& operator << (os         


        
9条回答
  •  萌比男神i
    2020-12-13 20:01

    Define it explicitly, e.g.:

    template <>
    ostream& operator << (ostream &out,Vector& vec)
    {
    }
    

提交回复
热议问题